001
002package com.commercetools.api.models.error;
003
004import java.time.*;
005import java.util.*;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.ModelBase;
012import io.vrap.rmf.base.client.utils.Generated;
013
014import org.apache.commons.lang3.builder.EqualsBuilder;
015import org.apache.commons.lang3.builder.HashCodeBuilder;
016
017/**
018 *  <p>Returned when the languages set for a Store are not supported by the Project.</p>
019 *  <p>The error is returned as a failed response to the Set Languages update action.</p>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class GraphQLProjectNotConfiguredForLanguagesErrorImpl
023        implements GraphQLProjectNotConfiguredForLanguagesError, ModelBase {
024
025    private String code;
026
027    private Map<String, java.lang.Object> values;
028
029    private java.util.List<String> languages;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    GraphQLProjectNotConfiguredForLanguagesErrorImpl(@JsonProperty("values") final Map<String, java.lang.Object> values,
036            @JsonProperty("languages") final java.util.List<String> languages) {
037        this.values = values;
038        this.languages = languages;
039        this.code = PROJECT_NOT_CONFIGURED_FOR_LANGUAGES;
040    }
041
042    /**
043     * create empty instance
044     */
045    public GraphQLProjectNotConfiguredForLanguagesErrorImpl() {
046        this.code = PROJECT_NOT_CONFIGURED_FOR_LANGUAGES;
047    }
048
049    /**
050     *
051     */
052
053    public String getCode() {
054        return this.code;
055    }
056
057    /**
058     *  <p>Error-specific additional fields.</p>
059     */
060
061    public Map<String, java.lang.Object> values() {
062        return values;
063    }
064
065    /**
066     *  <p>Languages configured for the Store.</p>
067     */
068
069    public java.util.List<String> getLanguages() {
070        return this.languages;
071    }
072
073    public void setValue(String key, java.lang.Object value) {
074        if (values == null) {
075            values = new HashMap<>();
076        }
077        values.put(key, value);
078    }
079
080    public void setLanguages(final String... languages) {
081        this.languages = new ArrayList<>(Arrays.asList(languages));
082    }
083
084    public void setLanguages(final java.util.List<String> languages) {
085        this.languages = languages;
086    }
087
088    @Override
089    public boolean equals(Object o) {
090        if (this == o)
091            return true;
092
093        if (o == null || getClass() != o.getClass())
094            return false;
095
096        GraphQLProjectNotConfiguredForLanguagesErrorImpl that = (GraphQLProjectNotConfiguredForLanguagesErrorImpl) o;
097
098        return new EqualsBuilder().append(code, that.code)
099                .append(values, that.values)
100                .append(languages, that.languages)
101                .isEquals();
102    }
103
104    @Override
105    public int hashCode() {
106        return new HashCodeBuilder(17, 37).append(code).append(values).append(languages).toHashCode();
107    }
108
109}