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 during an order update of AttributeEnumType or AttributeLocalizedEnumType the new enum values do not match the existing ones.</p>
019 *  <p>The error is returned as a failed response to the Change the order of EnumValues and Change the order of LocalizedEnumValues update actions.</p>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class GraphQLEnumValuesMustMatchErrorImpl implements GraphQLEnumValuesMustMatchError, ModelBase {
023
024    private String code;
025
026    private Map<String, java.lang.Object> values;
027
028    /**
029     * create instance with all properties
030     */
031    @JsonCreator
032    GraphQLEnumValuesMustMatchErrorImpl(@JsonProperty("values") final Map<String, java.lang.Object> values) {
033        this.values = values;
034        this.code = ENUM_VALUES_MUST_MATCH;
035    }
036
037    /**
038     * create empty instance
039     */
040    public GraphQLEnumValuesMustMatchErrorImpl() {
041        this.code = ENUM_VALUES_MUST_MATCH;
042    }
043
044    /**
045     *
046     */
047
048    public String getCode() {
049        return this.code;
050    }
051
052    /**
053     *  <p>Error-specific additional fields.</p>
054     */
055
056    public Map<String, java.lang.Object> values() {
057        return values;
058    }
059
060    public void setValue(String key, java.lang.Object value) {
061        if (values == null) {
062            values = new HashMap<>();
063        }
064        values.put(key, value);
065    }
066
067    @Override
068    public boolean equals(Object o) {
069        if (this == o)
070            return true;
071
072        if (o == null || getClass() != o.getClass())
073            return false;
074
075        GraphQLEnumValuesMustMatchErrorImpl that = (GraphQLEnumValuesMustMatchErrorImpl) o;
076
077        return new EqualsBuilder().append(code, that.code)
078                .append(values, that.values)
079                .append(code, that.code)
080                .append(values, that.values)
081                .isEquals();
082    }
083
084    @Override
085    public int hashCode() {
086        return new HashCodeBuilder(17, 37).append(code).append(values).toHashCode();
087    }
088
089}