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 Set ShoppingListLineItem Custom Field update action.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class SetShoppingListLineItemCustomFieldChangeImpl
022        implements SetShoppingListLineItemCustomFieldChange, ModelBase {
023
024    private String type;
025
026    private String change;
027
028    private java.lang.Object previousValue;
029
030    private java.lang.Object nextValue;
031
032    private String name;
033
034    private String customTypeId;
035
036    private com.commercetools.history.models.change_value.ShoppingListLineItemValue lineItem;
037
038    /**
039     * create instance with all properties
040     */
041    @JsonCreator
042    SetShoppingListLineItemCustomFieldChangeImpl(@JsonProperty("change") final String change,
043            @JsonProperty("previousValue") final java.lang.Object previousValue,
044            @JsonProperty("nextValue") final java.lang.Object nextValue, @JsonProperty("name") final String name,
045            @JsonProperty("customTypeId") final String customTypeId,
046            @JsonProperty("lineItem") final com.commercetools.history.models.change_value.ShoppingListLineItemValue lineItem) {
047        this.change = change;
048        this.previousValue = previousValue;
049        this.nextValue = nextValue;
050        this.name = name;
051        this.customTypeId = customTypeId;
052        this.lineItem = lineItem;
053        this.type = SET_SHOPPING_LIST_LINE_ITEM_CUSTOM_FIELD_CHANGE;
054    }
055
056    /**
057     * create empty instance
058     */
059    public SetShoppingListLineItemCustomFieldChangeImpl() {
060        this.type = SET_SHOPPING_LIST_LINE_ITEM_CUSTOM_FIELD_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 java.lang.Object getPreviousValue() {
084        return this.previousValue;
085    }
086
087    /**
088     *  <p>Value after the change.</p>
089     */
090
091    public java.lang.Object getNextValue() {
092        return this.nextValue;
093    }
094
095    /**
096     *  <p>Name of the Custom Field.</p>
097     */
098
099    public String getName() {
100        return this.name;
101    }
102
103    /**
104     *  <p><code>id</code> of the referenced Type.</p>
105     */
106
107    public String getCustomTypeId() {
108        return this.customTypeId;
109    }
110
111    /**
112     *  <p>Holds information about the updated Shopping List Line Item.</p>
113     */
114
115    public com.commercetools.history.models.change_value.ShoppingListLineItemValue getLineItem() {
116        return this.lineItem;
117    }
118
119    public void setChange(final String change) {
120        this.change = change;
121    }
122
123    public void setPreviousValue(final java.lang.Object previousValue) {
124        this.previousValue = previousValue;
125    }
126
127    public void setNextValue(final java.lang.Object nextValue) {
128        this.nextValue = nextValue;
129    }
130
131    public void setName(final String name) {
132        this.name = name;
133    }
134
135    public void setCustomTypeId(final String customTypeId) {
136        this.customTypeId = customTypeId;
137    }
138
139    public void setLineItem(final com.commercetools.history.models.change_value.ShoppingListLineItemValue lineItem) {
140        this.lineItem = lineItem;
141    }
142
143    @Override
144    public boolean equals(Object o) {
145        if (this == o)
146            return true;
147
148        if (o == null || getClass() != o.getClass())
149            return false;
150
151        SetShoppingListLineItemCustomFieldChangeImpl that = (SetShoppingListLineItemCustomFieldChangeImpl) o;
152
153        return new EqualsBuilder().append(type, that.type)
154                .append(change, that.change)
155                .append(previousValue, that.previousValue)
156                .append(nextValue, that.nextValue)
157                .append(name, that.name)
158                .append(customTypeId, that.customTypeId)
159                .append(lineItem, that.lineItem)
160                .append(type, that.type)
161                .append(change, that.change)
162                .append(previousValue, that.previousValue)
163                .append(nextValue, that.nextValue)
164                .append(name, that.name)
165                .append(customTypeId, that.customTypeId)
166                .append(lineItem, that.lineItem)
167                .isEquals();
168    }
169
170    @Override
171    public int hashCode() {
172        return new HashCodeBuilder(17, 37).append(type)
173                .append(change)
174                .append(previousValue)
175                .append(nextValue)
176                .append(name)
177                .append(customTypeId)
178                .append(lineItem)
179                .toHashCode();
180    }
181
182}