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 LineItem CustomField on Orders.</li>
021 *   <li>Set LineItem CustomField on Staged Orders.</li>
022 *  </ul>
023 */
024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
025public class SetOrderLineItemCustomFieldChangeImpl implements SetOrderLineItemCustomFieldChange, 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 customTypeId;
036
037    private String name;
038
039    private com.commercetools.history.models.common.LocalizedString lineItem;
040
041    private String variant;
042
043    /**
044     * create instance with all properties
045     */
046    @JsonCreator
047    SetOrderLineItemCustomFieldChangeImpl(@JsonProperty("change") final String change,
048            @JsonProperty("previousValue") final java.lang.Object previousValue,
049            @JsonProperty("nextValue") final java.lang.Object nextValue,
050            @JsonProperty("customTypeId") final String customTypeId, @JsonProperty("name") final String name,
051            @JsonProperty("lineItem") final com.commercetools.history.models.common.LocalizedString lineItem,
052            @JsonProperty("variant") final String variant) {
053        this.change = change;
054        this.previousValue = previousValue;
055        this.nextValue = nextValue;
056        this.customTypeId = customTypeId;
057        this.name = name;
058        this.lineItem = lineItem;
059        this.variant = variant;
060        this.type = SET_ORDER_LINE_ITEM_CUSTOM_FIELD_CHANGE;
061    }
062
063    /**
064     * create empty instance
065     */
066    public SetOrderLineItemCustomFieldChangeImpl() {
067        this.type = SET_ORDER_LINE_ITEM_CUSTOM_FIELD_CHANGE;
068    }
069
070    /**
071     *
072     */
073
074    public String getType() {
075        return this.type;
076    }
077
078    /**
079     *
080     */
081
082    public String getChange() {
083        return this.change;
084    }
085
086    /**
087     *  <p>Value before the change.</p>
088     */
089
090    public java.lang.Object getPreviousValue() {
091        return this.previousValue;
092    }
093
094    /**
095     *  <p>Value after the change.</p>
096     */
097
098    public java.lang.Object getNextValue() {
099        return this.nextValue;
100    }
101
102    /**
103     *  <p><code>id</code> of the referenced Type.</p>
104     */
105
106    public String getCustomTypeId() {
107        return this.customTypeId;
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>Name of the Product the Line Item is based on.</p>
120     */
121
122    public com.commercetools.history.models.common.LocalizedString getLineItem() {
123        return this.lineItem;
124    }
125
126    /**
127     *  <p><code>sku</code> or <code>key</code> of the ProductVariant.</p>
128     */
129
130    public String getVariant() {
131        return this.variant;
132    }
133
134    public void setChange(final String change) {
135        this.change = change;
136    }
137
138    public void setPreviousValue(final java.lang.Object previousValue) {
139        this.previousValue = previousValue;
140    }
141
142    public void setNextValue(final java.lang.Object nextValue) {
143        this.nextValue = nextValue;
144    }
145
146    public void setCustomTypeId(final String customTypeId) {
147        this.customTypeId = customTypeId;
148    }
149
150    public void setName(final String name) {
151        this.name = name;
152    }
153
154    public void setLineItem(final com.commercetools.history.models.common.LocalizedString lineItem) {
155        this.lineItem = lineItem;
156    }
157
158    public void setVariant(final String variant) {
159        this.variant = variant;
160    }
161
162    @Override
163    public boolean equals(Object o) {
164        if (this == o)
165            return true;
166
167        if (o == null || getClass() != o.getClass())
168            return false;
169
170        SetOrderLineItemCustomFieldChangeImpl that = (SetOrderLineItemCustomFieldChangeImpl) o;
171
172        return new EqualsBuilder().append(type, that.type)
173                .append(change, that.change)
174                .append(previousValue, that.previousValue)
175                .append(nextValue, that.nextValue)
176                .append(customTypeId, that.customTypeId)
177                .append(name, that.name)
178                .append(lineItem, that.lineItem)
179                .append(variant, that.variant)
180                .append(type, that.type)
181                .append(change, that.change)
182                .append(previousValue, that.previousValue)
183                .append(nextValue, that.nextValue)
184                .append(customTypeId, that.customTypeId)
185                .append(name, that.name)
186                .append(lineItem, that.lineItem)
187                .append(variant, that.variant)
188                .isEquals();
189    }
190
191    @Override
192    public int hashCode() {
193        return new HashCodeBuilder(17, 37).append(type)
194                .append(change)
195                .append(previousValue)
196                .append(nextValue)
197                .append(customTypeId)
198                .append(name)
199                .append(lineItem)
200                .append(variant)
201                .toHashCode();
202    }
203
204}