// Path: src/main/java/com/github/mkopylec/errorest/configuration/ErrorestProperties.java
// public enum ResponseBodyFormat {
//     WITHOUT_DESCRIPTIONS, FULL
// }


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.github.mkopylec.errorest.configuration.ErrorestProperties.ResponseBodyFormat;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
package com.github.mkopylec.errorest.response;



public class Error {

    public static final String DESCRIPTION_NOT_AVAILABLE = "N/A";

    protected final String code;
    protected String description;

    @JsonCreator
    public Error(
            @JsonProperty("code") @JacksonXmlProperty(localName = "code") String code,
            @JsonProperty("description") @JacksonXmlProperty(localName = "description") String description
    ) {
        this.code = code;
        this.description = isNotBlank(description) ? description : DESCRIPTION_NOT_AVAILABLE;
    }

    public String getCode() {
        return code;
    }

    public boolean hasCode(String code) {
        return this.code.equals(code);
    }

    public String getDescription() {
        return description;
    }

    public boolean hasDescription() {
        return !description.equals(DESCRIPTION_NOT_AVAILABLE);
    }

    public boolean hasDescription(String description) {
        return this.description.equals(description);
    }

// 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/response/Error.java
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.github.mkopylec.errorest.configuration.ErrorestProperties.ResponseBodyFormat;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import static org.apache.commons.lang3.StringUtils.isNotBlank;

package com.github.mkopylec.errorest.response;



public class Error {

    public static final String DESCRIPTION_NOT_AVAILABLE = "N/A";

    protected final String code;
    protected String description;

    @JsonCreator
    public Error(
            @JsonProperty("code") @JacksonXmlProperty(localName = "code") String code,
            @JsonProperty("description") @JacksonXmlProperty(localName = "description") String description
    ) {
        this.code = code;
        this.description = isNotBlank(description) ? description : DESCRIPTION_NOT_AVAILABLE;
    }

    public String getCode() {
        return code;
    }

    public boolean hasCode(String code) {
        return this.code.equals(code);
    }

    public String getDescription() {
        return description;
    }

    public boolean hasDescription() {
        return !description.equals(DESCRIPTION_NOT_AVAILABLE);
    }

    public boolean hasDescription(String description) {
        return this.description.equals(description);
    }

    public void format(ResponseBodyFormat bodyFormat) {