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 CustomLineItem TaxAmount update action.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class SetCustomLineItemTaxAmountChangeImpl implements SetCustomLineItemTaxAmountChange, ModelBase {
022
023    private String type;
024
025    private String change;
026
027    private com.commercetools.history.models.common.TaxRate previousValue;
028
029    private com.commercetools.history.models.common.TaxRate nextValue;
030
031    private com.commercetools.history.models.common.LocalizedString customLineItem;
032
033    private String customLineItemId;
034
035    private com.commercetools.history.models.common.TaxMode taxMode;
036
037    /**
038     * create instance with all properties
039     */
040    @JsonCreator
041    SetCustomLineItemTaxAmountChangeImpl(@JsonProperty("change") final String change,
042            @JsonProperty("previousValue") final com.commercetools.history.models.common.TaxRate previousValue,
043            @JsonProperty("nextValue") final com.commercetools.history.models.common.TaxRate nextValue,
044            @JsonProperty("customLineItem") final com.commercetools.history.models.common.LocalizedString customLineItem,
045            @JsonProperty("customLineItemId") final String customLineItemId,
046            @JsonProperty("taxMode") final com.commercetools.history.models.common.TaxMode taxMode) {
047        this.change = change;
048        this.previousValue = previousValue;
049        this.nextValue = nextValue;
050        this.customLineItem = customLineItem;
051        this.customLineItemId = customLineItemId;
052        this.taxMode = taxMode;
053        this.type = SET_CUSTOM_LINE_ITEM_TAX_AMOUNT_CHANGE;
054    }
055
056    /**
057     * create empty instance
058     */
059    public SetCustomLineItemTaxAmountChangeImpl() {
060        this.type = SET_CUSTOM_LINE_ITEM_TAX_AMOUNT_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.TaxRate getPreviousValue() {
084        return this.previousValue;
085    }
086
087    /**
088     *  <p>Value after the change.</p>
089     */
090
091    public com.commercetools.history.models.common.TaxRate getNextValue() {
092        return this.nextValue;
093    }
094
095    /**
096     *  <p>Name of the updated CustomLineItem.</p>
097     */
098
099    public com.commercetools.history.models.common.LocalizedString getCustomLineItem() {
100        return this.customLineItem;
101    }
102
103    /**
104     *  <p><code>id</code> of the updated CustomLineItem.</p>
105     */
106
107    public String getCustomLineItemId() {
108        return this.customLineItemId;
109    }
110
111    /**
112     *  <p><code>"ExternalAmount"</code></p>
113     */
114
115    public com.commercetools.history.models.common.TaxMode getTaxMode() {
116        return this.taxMode;
117    }
118
119    public void setChange(final String change) {
120        this.change = change;
121    }
122
123    public void setPreviousValue(final com.commercetools.history.models.common.TaxRate previousValue) {
124        this.previousValue = previousValue;
125    }
126
127    public void setNextValue(final com.commercetools.history.models.common.TaxRate nextValue) {
128        this.nextValue = nextValue;
129    }
130
131    public void setCustomLineItem(final com.commercetools.history.models.common.LocalizedString customLineItem) {
132        this.customLineItem = customLineItem;
133    }
134
135    public void setCustomLineItemId(final String customLineItemId) {
136        this.customLineItemId = customLineItemId;
137    }
138
139    public void setTaxMode(final com.commercetools.history.models.common.TaxMode taxMode) {
140        this.taxMode = taxMode;
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        SetCustomLineItemTaxAmountChangeImpl that = (SetCustomLineItemTaxAmountChangeImpl) 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(customLineItem, that.customLineItem)
158                .append(customLineItemId, that.customLineItemId)
159                .append(taxMode, that.taxMode)
160                .append(type, that.type)
161                .append(change, that.change)
162                .append(previousValue, that.previousValue)
163                .append(nextValue, that.nextValue)
164                .append(customLineItem, that.customLineItem)
165                .append(customLineItemId, that.customLineItemId)
166                .append(taxMode, that.taxMode)
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(customLineItem)
177                .append(customLineItemId)
178                .append(taxMode)
179                .toHashCode();
180    }
181
182}