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>Set Asset CustomField on Categories.</li>
021 *   <li>Set Asset CustomField on Products.</li>
022 *  </ul>
023 */
024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
025public class SetAssetCustomFieldChangeImpl implements SetAssetCustomFieldChange, ModelBase {
026
027    private String type;
028
029    private String change;
030
031    private java.lang.Object previousValue;
032
033    private java.lang.Object nextValue;
034
035    private String name;
036
037    private String customTypeId;
038
039    private com.commercetools.history.models.change_value.AssetChangeValue asset;
040
041    /**
042     * create instance with all properties
043     */
044    @JsonCreator
045    SetAssetCustomFieldChangeImpl(@JsonProperty("change") final String change,
046            @JsonProperty("previousValue") final java.lang.Object previousValue,
047            @JsonProperty("nextValue") final java.lang.Object nextValue, @JsonProperty("name") final String name,
048            @JsonProperty("customTypeId") final String customTypeId,
049            @JsonProperty("asset") final com.commercetools.history.models.change_value.AssetChangeValue asset) {
050        this.change = change;
051        this.previousValue = previousValue;
052        this.nextValue = nextValue;
053        this.name = name;
054        this.customTypeId = customTypeId;
055        this.asset = asset;
056        this.type = SET_ASSET_CUSTOM_FIELD_CHANGE;
057    }
058
059    /**
060     * create empty instance
061     */
062    public SetAssetCustomFieldChangeImpl() {
063        this.type = SET_ASSET_CUSTOM_FIELD_CHANGE;
064    }
065
066    /**
067     *
068     */
069
070    public String getType() {
071        return this.type;
072    }
073
074    /**
075     *
076     */
077
078    public String getChange() {
079        return this.change;
080    }
081
082    /**
083     *  <p>Value before the change.</p>
084     */
085
086    public java.lang.Object getPreviousValue() {
087        return this.previousValue;
088    }
089
090    /**
091     *  <p>Value after the change.</p>
092     */
093
094    public java.lang.Object getNextValue() {
095        return this.nextValue;
096    }
097
098    /**
099     *  <p>Name of the Custom Field.</p>
100     */
101
102    public String getName() {
103        return this.name;
104    }
105
106    /**
107     *  <p><code>id</code> of the referenced Type.</p>
108     */
109
110    public String getCustomTypeId() {
111        return this.customTypeId;
112    }
113
114    /**
115     *  <p>Information about the updated Asset.</p>
116     */
117
118    public com.commercetools.history.models.change_value.AssetChangeValue getAsset() {
119        return this.asset;
120    }
121
122    public void setChange(final String change) {
123        this.change = change;
124    }
125
126    public void setPreviousValue(final java.lang.Object previousValue) {
127        this.previousValue = previousValue;
128    }
129
130    public void setNextValue(final java.lang.Object nextValue) {
131        this.nextValue = nextValue;
132    }
133
134    public void setName(final String name) {
135        this.name = name;
136    }
137
138    public void setCustomTypeId(final String customTypeId) {
139        this.customTypeId = customTypeId;
140    }
141
142    public void setAsset(final com.commercetools.history.models.change_value.AssetChangeValue asset) {
143        this.asset = asset;
144    }
145
146    @Override
147    public boolean equals(Object o) {
148        if (this == o)
149            return true;
150
151        if (o == null || getClass() != o.getClass())
152            return false;
153
154        SetAssetCustomFieldChangeImpl that = (SetAssetCustomFieldChangeImpl) o;
155
156        return new EqualsBuilder().append(type, that.type)
157                .append(change, that.change)
158                .append(previousValue, that.previousValue)
159                .append(nextValue, that.nextValue)
160                .append(name, that.name)
161                .append(customTypeId, that.customTypeId)
162                .append(asset, that.asset)
163                .append(type, that.type)
164                .append(change, that.change)
165                .append(previousValue, that.previousValue)
166                .append(nextValue, that.nextValue)
167                .append(name, that.name)
168                .append(customTypeId, that.customTypeId)
169                .append(asset, that.asset)
170                .isEquals();
171    }
172
173    @Override
174    public int hashCode() {
175        return new HashCodeBuilder(17, 37).append(type)
176                .append(change)
177                .append(previousValue)
178                .append(nextValue)
179                .append(name)
180                .append(customTypeId)
181                .append(asset)
182                .toHashCode();
183    }
184
185}