package de.avatic.lcc.dto.error;


import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;

public class ErrorDTO {
    private String code;
    private String title;
    private String message;
    private List<StackTraceElement> trace;
    private String traceCombined;

    public ErrorDTO() {
    }

    public ErrorDTO(String code, String title, String message, List<StackTraceElement> trace) {
        this.code = code;
        this.title = title;
        this.message = message;
        this.trace = trace;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }


    public List<StackTraceElement> getTrace() {
        return trace;
    }

    public void setTrace(List<StackTraceElement> trace) {
        this.trace = trace;
    }

    @Override
    public String toString() {
        return "ErrorDTO{" +
                "code='" + code + '\'' +
                ", message='" + message + '\'' +
                ", trace=" + trace +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ErrorDTO errorDTO = (ErrorDTO) o;
        return Objects.equals(code, errorDTO.code) &&
                Objects.equals(message, errorDTO.message) &&
                Objects.equals(trace, errorDTO.trace);
    }

    @Override
    public int hashCode() {
        return Objects.hash(code, message, trace);
    }

    public String getTraceCombined() {
        return traceCombined;
    }

    public void setTraceCombined(String traceCombined) {
        this.traceCombined = traceCombined;
    }
}
