001
002package com.commercetools.history.models.change;
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>Change triggered by the following update actions:</p>
019 *  <ul>
020 *   <li>Change the label of a LocalizedEnumValue on Product Types.</li>
021 *   <li>Change LocalizedEnumValue Label on Types.</li>
022 *  </ul>
023 */
024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
025public class ChangeLocalizedEnumValueLabelChangeImpl implements ChangeLocalizedEnumValueLabelChange, ModelBase {
026
027    private String type;
028
029    private String change;
030
031    private com.commercetools.history.models.common.LocalizedString previousValue;
032
033    private com.commercetools.history.models.common.LocalizedString nextValue;
034
035    private String fieldName;
036
037    private String attributeName;
038
039    private String valueKey;
040
041    /**
042     * create instance with all properties
043     */
044    @JsonCreator
045    ChangeLocalizedEnumValueLabelChangeImpl(@JsonProperty("change") final String change,
046            @JsonProperty("previousValue") final com.commercetools.history.models.common.LocalizedString previousValue,
047            @JsonProperty("nextValue") final com.commercetools.history.models.common.LocalizedString nextValue,
048            @JsonProperty("fieldName") final String fieldName,
049            @JsonProperty("attributeName") final String attributeName,
050            @JsonProperty("valueKey") final String valueKey) {
051        this.change = change;
052        this.previousValue = previousValue;
053        this.nextValue = nextValue;
054        this.fieldName = fieldName;
055        this.attributeName = attributeName;
056        this.valueKey = valueKey;
057        this.type = CHANGE_LOCALIZED_ENUM_VALUE_LABEL_CHANGE;
058    }
059
060    /**
061     * create empty instance
062     */
063    public ChangeLocalizedEnumValueLabelChangeImpl() {
064        this.type = CHANGE_LOCALIZED_ENUM_VALUE_LABEL_CHANGE;
065    }
066
067    /**
068     *
069     */
070
071    public String getType() {
072        return this.type;
073    }
074
075    /**
076     *
077     */
078
079    public String getChange() {
080        return this.change;
081    }
082
083    /**
084     *  <p>Value before the change.</p>
085     */
086
087    public com.commercetools.history.models.common.LocalizedString getPreviousValue() {
088        return this.previousValue;
089    }
090
091    /**
092     *  <p>Value after the change.</p>
093     */
094
095    public com.commercetools.history.models.common.LocalizedString getNextValue() {
096        return this.nextValue;
097    }
098
099    /**
100     *  <p>Name of the updated FieldDefinition; only present on changes to Types.</p>
101     */
102
103    public String getFieldName() {
104        return this.fieldName;
105    }
106
107    /**
108     *  <p>Name of the updated AttributeDefinition; only present on changes to Product Types.</p>
109     */
110
111    public String getAttributeName() {
112        return this.attributeName;
113    }
114
115    /**
116     *  <p>Key of the updated values.</p>
117     */
118
119    public String getValueKey() {
120        return this.valueKey;
121    }
122
123    public void setChange(final String change) {
124        this.change = change;
125    }
126
127    public void setPreviousValue(final com.commercetools.history.models.common.LocalizedString previousValue) {
128        this.previousValue = previousValue;
129    }
130
131    public void setNextValue(final com.commercetools.history.models.common.LocalizedString nextValue) {
132        this.nextValue = nextValue;
133    }
134
135    public void setFieldName(final String fieldName) {
136        this.fieldName = fieldName;
137    }
138
139    public void setAttributeName(final String attributeName) {
140        this.attributeName = attributeName;
141    }
142
143    public void setValueKey(final String valueKey) {
144        this.valueKey = valueKey;
145    }
146
147    @Override
148    public boolean equals(Object o) {
149        if (this == o)
150            return true;
151
152        if (o == null || getClass() != o.getClass())
153            return false;
154
155        ChangeLocalizedEnumValueLabelChangeImpl that = (ChangeLocalizedEnumValueLabelChangeImpl) o;
156
157        return new EqualsBuilder().append(type, that.type)
158                .append(change, that.change)
159                .append(previousValue, that.previousValue)
160                .append(nextValue, that.nextValue)
161                .append(fieldName, that.fieldName)
162                .append(attributeName, that.attributeName)
163                .append(valueKey, that.valueKey)
164                .append(type, that.type)
165                .append(change, that.change)
166                .append(previousValue, that.previousValue)
167                .append(nextValue, that.nextValue)
168                .append(fieldName, that.fieldName)
169                .append(attributeName, that.attributeName)
170                .append(valueKey, that.valueKey)
171                .isEquals();
172    }
173
174    @Override
175    public int hashCode() {
176        return new HashCodeBuilder(17, 37).append(type)
177                .append(change)
178                .append(previousValue)
179                .append(nextValue)
180                .append(fieldName)
181                .append(attributeName)
182                .append(valueKey)
183                .toHashCode();
184    }
185
186}