package com.github.mkopylec.errorest.exceptions;

import com.github.mkopylec.errorest.logging.ErrorsLoggingList;
import com.github.mkopylec.errorest.logging.LoggingLevel;
import com.github.mkopylec.errorest.response.Error;
import org.springframework.http.HttpStatus;

import java.util.List;

public class ApplicationExceptionConfiguration {

    protected final List<Error> errors = new ErrorsLoggingList();
    protected HttpStatus responseHttpStatus;
    protected LoggingLevel loggingLevel;
    protected Throwable cause;

    public List<Error> getErrors() {
        return errors;
    }

    public ApplicationExceptionConfiguration addError(String code, String description) {
        errors.add(new Error(code, description));
        return this;
    }

    public HttpStatus getResponseHttpStatus() {
        return responseHttpStatus;
    }

    public ApplicationExceptionConfiguration withResponseHttpStatus(HttpStatus responseHttpStatus) {
        this.responseHttpStatus = responseHttpStatus;
        return this;
    }

    public LoggingLevel getLoggingLevel() {
        return loggingLevel;
    }

    public ApplicationExceptionConfiguration withLoggingLevel(LoggingLevel loggingLevel) {
        this.loggingLevel = loggingLevel;
        return this;
    }

    public Throwable getCause() {
        return cause;
    }

    public ApplicationExceptionConfiguration withCause(Throwable cause) {
        this.cause = cause;
        return this;
    }
}

@@ -353,14 +353,8 @@
 ted 
-final 
 List
@@ -395,16 +395,16 @@
 List();%0A
+
     prot
@@ -518,21 +518,24 @@
 ;%0A%0A    p
-ublic
+rotected
  List%3CEr
@@ -761,16 +761,161 @@
  public 
+ApplicationExceptionConfiguration withErrors(ErrorsLoggingList errors) %7B%0A        this.errors = errors;%0A        return this;%0A    %7D%0A%0A    protected 
 HttpStat
@@ -1173,21 +1173,24 @@
 %7D%0A%0A    p
-ublic
+rotected
  Logging
@@ -1417,21 +1417,24 @@
 %7D%0A%0A    p
-ublic
+rotected
  Throwab

decrease access level for app ex config