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