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 CustomField on Cart Discounts.</li>
021 *   <li>Set CustomField on Categories.</li>
022 *   <li>Set CustomField on Channels.</li>
023 *   <li>Set CustomField on Customers.</li>
024 *   <li>Set CustomField on Customer Groups.</li>
025 *   <li>Set CustomField on Discount Codes.</li>
026 *   <li>Set CustomField on Inventories.</li>
027 *   <li>Set CustomField on Orders.</li>
028 *   <li>Set CustomField on Order Edits.</li>
029 *   <li>Set CustomField on Payments.</li>
030 *   <li>Set CustomField on Product Selections.</li>
031 *   <li>Set CustomField on Quotes.</li>
032 *   <li>Set CustomField on Quote Requests.</li>
033 *   <li>Set CustomField on Reviews.</li>
034 *   <li>Set CustomField on Shopping Lists.</li>
035 *   <li>Set CustomField on Staged Orders.</li>
036 *   <li>Set CustomField on Staged Quotes.</li>
037 *   <li>Set CustomField on Stores.</li>
038 *  </ul>
039 */
040@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
041public class SetCustomFieldChangeImpl implements SetCustomFieldChange, ModelBase {
042
043    private String type;
044
045    private String change;
046
047    private java.lang.Object previousValue;
048
049    private java.lang.Object nextValue;
050
051    private String name;
052
053    private String customTypeId;
054
055    /**
056     * create instance with all properties
057     */
058    @JsonCreator
059    SetCustomFieldChangeImpl(@JsonProperty("change") final String change,
060            @JsonProperty("previousValue") final java.lang.Object previousValue,
061            @JsonProperty("nextValue") final java.lang.Object nextValue, @JsonProperty("name") final String name,
062            @JsonProperty("customTypeId") final String customTypeId) {
063        this.change = change;
064        this.previousValue = previousValue;
065        this.nextValue = nextValue;
066        this.name = name;
067        this.customTypeId = customTypeId;
068        this.type = SET_CUSTOM_FIELD_CHANGE;
069    }
070
071    /**
072     * create empty instance
073     */
074    public SetCustomFieldChangeImpl() {
075        this.type = SET_CUSTOM_FIELD_CHANGE;
076    }
077
078    /**
079     *
080     */
081
082    public String getType() {
083        return this.type;
084    }
085
086    /**
087     *
088     */
089
090    public String getChange() {
091        return this.change;
092    }
093
094    /**
095     *  <p>Value before the change.</p>
096     */
097
098    public java.lang.Object getPreviousValue() {
099        return this.previousValue;
100    }
101
102    /**
103     *  <p>Value after the change.</p>
104     */
105
106    public java.lang.Object getNextValue() {
107        return this.nextValue;
108    }
109
110    /**
111     *  <p>Name of the Custom Field.</p>
112     */
113
114    public String getName() {
115        return this.name;
116    }
117
118    /**
119     *  <p><code>id</code> of the referenced Type.</p>
120     */
121
122    public String getCustomTypeId() {
123        return this.customTypeId;
124    }
125
126    public void setChange(final String change) {
127        this.change = change;
128    }
129
130    public void setPreviousValue(final java.lang.Object previousValue) {
131        this.previousValue = previousValue;
132    }
133
134    public void setNextValue(final java.lang.Object nextValue) {
135        this.nextValue = nextValue;
136    }
137
138    public void setName(final String name) {
139        this.name = name;
140    }
141
142    public void setCustomTypeId(final String customTypeId) {
143        this.customTypeId = customTypeId;
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        SetCustomFieldChangeImpl that = (SetCustomFieldChangeImpl) 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(type, that.type)
163                .append(change, that.change)
164                .append(previousValue, that.previousValue)
165                .append(nextValue, that.nextValue)
166                .append(name, that.name)
167                .append(customTypeId, that.customTypeId)
168                .isEquals();
169    }
170
171    @Override
172    public int hashCode() {
173        return new HashCodeBuilder(17, 37).append(type)
174                .append(change)
175                .append(previousValue)
176                .append(nextValue)
177                .append(name)
178                .append(customTypeId)
179                .toHashCode();
180    }
181
182}