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 Custom Type on Orders.</li>
021 *   <li>Set LineItem Custom Type 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 SetOrderLineItemCustomTypeChangeImpl implements SetOrderLineItemCustomTypeChange, ModelBase {
026
027    private String type;
028
029    private String change;
030
031    private com.commercetools.history.models.common.CustomFields previousValue;
032
033    private com.commercetools.history.models.common.CustomFields nextValue;
034
035    private com.commercetools.history.models.common.LocalizedString lineItem;
036
037    private String variant;
038
039    /**
040     * create instance with all properties
041     */
042    @JsonCreator
043    SetOrderLineItemCustomTypeChangeImpl(@JsonProperty("change") final String change,
044            @JsonProperty("previousValue") final com.commercetools.history.models.common.CustomFields previousValue,
045            @JsonProperty("nextValue") final com.commercetools.history.models.common.CustomFields nextValue,
046            @JsonProperty("lineItem") final com.commercetools.history.models.common.LocalizedString lineItem,
047            @JsonProperty("variant") final String variant) {
048        this.change = change;
049        this.previousValue = previousValue;
050        this.nextValue = nextValue;
051        this.lineItem = lineItem;
052        this.variant = variant;
053        this.type = SET_ORDER_LINE_ITEM_CUSTOM_TYPE_CHANGE;
054    }
055
056    /**
057     * create empty instance
058     */
059    public SetOrderLineItemCustomTypeChangeImpl() {
060        this.type = SET_ORDER_LINE_ITEM_CUSTOM_TYPE_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.CustomFields getPreviousValue() {
084        return this.previousValue;
085    }
086
087    /**
088     *  <p>Value after the change.</p>
089     */
090
091    public com.commercetools.history.models.common.CustomFields getNextValue() {
092        return this.nextValue;
093    }
094
095    /**
096     *  <p>Name of the Product the updated Line Item is based on.</p>
097     */
098
099    public com.commercetools.history.models.common.LocalizedString getLineItem() {
100        return this.lineItem;
101    }
102
103    /**
104     *  <p><code>sku</code> or <code>key</code> of the ProductVariant.</p>
105     */
106
107    public String getVariant() {
108        return this.variant;
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.CustomFields previousValue) {
116        this.previousValue = previousValue;
117    }
118
119    public void setNextValue(final com.commercetools.history.models.common.CustomFields nextValue) {
120        this.nextValue = nextValue;
121    }
122
123    public void setLineItem(final com.commercetools.history.models.common.LocalizedString lineItem) {
124        this.lineItem = lineItem;
125    }
126
127    public void setVariant(final String variant) {
128        this.variant = variant;
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        SetOrderLineItemCustomTypeChangeImpl that = (SetOrderLineItemCustomTypeChangeImpl) 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(lineItem, that.lineItem)
146                .append(variant, that.variant)
147                .append(type, that.type)
148                .append(change, that.change)
149                .append(previousValue, that.previousValue)
150                .append(nextValue, that.nextValue)
151                .append(lineItem, that.lineItem)
152                .append(variant, that.variant)
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(lineItem)
163                .append(variant)
164                .toHashCode();
165    }
166
167}