// Path: src/main/java/com/github/mkopylec/errorest/configuration/ErrorestProperties.java
// public enum ResponseBodyFormat {
//     WITHOUT_DESCRIPTIONS, FULL
// }
// 
// Path: src/main/java/com/github/mkopylec/errorest/logging/ErrorsLoggingList.java
// public class ErrorsLoggingList extends ArrayList<Error> {
// 
//     public ErrorsLoggingList() {
//         super(1);
//     }
// 
//     public ErrorsLoggingList(Collection<? extends Error> c) {
//         super(c);
//     }
// 
//     @Override
//     public String toString() {
//         return stream().map(Error::toString).collect(joining(" | "));
//     }
// }


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.github.mkopylec.errorest.configuration.ErrorestProperties.ResponseBodyFormat;
import com.github.mkopylec.errorest.logging.ErrorsLoggingList;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import java.util.List;
import static java.util.Collections.emptyList;
import static org.springframework.util.Assert.hasText;

    public String getId() {
        return id;
    }

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

    public boolean hasErrors() {
        return !errors.isEmpty();
    }

    public boolean containsErrorCode(String code) {
        return errors.stream().anyMatch(error -> error.hasCode(code));
    }

    public boolean containsErrorDescriptions() {
        return errors.stream().anyMatch(Error::hasDescription);
    }

    public boolean containsErrorDescription(String description) {
        return errors.stream().anyMatch(error -> error.hasDescription(description));
    }

    @JsonIgnore
    public boolean isEmpty() {
        return EMPTY_ERRORS_ID.equals(id) && !hasErrors();
    }

// Path: src/main/java/com/github/mkopylec/errorest/configuration/ErrorestProperties.java
// public enum ResponseBodyFormat {
//     WITHOUT_DESCRIPTIONS, FULL
// }
// 
// Path: src/main/java/com/github/mkopylec/errorest/logging/ErrorsLoggingList.java
// public class ErrorsLoggingList extends ArrayList<Error> {
// 
//     public ErrorsLoggingList() {
//         super(1);
//     }
// 
//     public ErrorsLoggingList(Collection<? extends Error> c) {
//         super(c);
//     }
// 
//     @Override
//     public String toString() {
//         return stream().map(Error::toString).collect(joining(" | "));
//     }
// }


// Path: src/main/java/com/github/mkopylec/errorest/response/Errors.java
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.github.mkopylec.errorest.configuration.ErrorestProperties.ResponseBodyFormat;
import com.github.mkopylec.errorest.logging.ErrorsLoggingList;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import java.util.List;
import static java.util.Collections.emptyList;
import static org.springframework.util.Assert.hasText;


    public String getId() {
        return id;
    }

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

    public boolean hasErrors() {
        return !errors.isEmpty();
    }

    public boolean containsErrorCode(String code) {
        return errors.stream().anyMatch(error -> error.hasCode(code));
    }

    public boolean containsErrorDescriptions() {
        return errors.stream().anyMatch(Error::hasDescription);
    }

    public boolean containsErrorDescription(String description) {
        return errors.stream().anyMatch(error -> error.hasDescription(description));
    }

    @JsonIgnore
    public boolean isEmpty() {
        return EMPTY_ERRORS_ID.equals(id) && !hasErrors();
    }

    public void formatErrors(ResponseBodyFormat bodyFormat) {