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