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 * SetLineItemDiscountedPriceChange
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class SetLineItemDiscountedPriceChangeImpl implements SetLineItemDiscountedPriceChange, ModelBase {
022
023    private String type;
024
025    private String change;
026
027    private com.commercetools.history.models.common.DiscountedLineItemPrice previousValue;
028
029    private com.commercetools.history.models.common.DiscountedLineItemPrice nextValue;
030
031    private com.commercetools.history.models.common.LocalizedString lineItem;
032
033    private String variant;
034
035    /**
036     * create instance with all properties
037     */
038    @JsonCreator
039    SetLineItemDiscountedPriceChangeImpl(@JsonProperty("change") final String change,
040            @JsonProperty("previousValue") final com.commercetools.history.models.common.DiscountedLineItemPrice previousValue,
041            @JsonProperty("nextValue") final com.commercetools.history.models.common.DiscountedLineItemPrice nextValue,
042            @JsonProperty("lineItem") final com.commercetools.history.models.common.LocalizedString lineItem,
043            @JsonProperty("variant") final String variant) {
044        this.change = change;
045        this.previousValue = previousValue;
046        this.nextValue = nextValue;
047        this.lineItem = lineItem;
048        this.variant = variant;
049        this.type = SET_LINE_ITEM_DISCOUNTED_PRICE_CHANGE;
050    }
051
052    /**
053     * create empty instance
054     */
055    public SetLineItemDiscountedPriceChangeImpl() {
056        this.type = SET_LINE_ITEM_DISCOUNTED_PRICE_CHANGE;
057    }
058
059    /**
060     *
061     */
062
063    public String getType() {
064        return this.type;
065    }
066
067    /**
068     *
069     */
070
071    public String getChange() {
072        return this.change;
073    }
074
075    /**
076     *  <p>Value before the change.</p>
077     */
078
079    public com.commercetools.history.models.common.DiscountedLineItemPrice getPreviousValue() {
080        return this.previousValue;
081    }
082
083    /**
084     *  <p>Value after the change.</p>
085     */
086
087    public com.commercetools.history.models.common.DiscountedLineItemPrice getNextValue() {
088        return this.nextValue;
089    }
090
091    /**
092     *  <p>Name of the Product the Line Item is based on.</p>
093     */
094
095    public com.commercetools.history.models.common.LocalizedString getLineItem() {
096        return this.lineItem;
097    }
098
099    /**
100     *  <p><code>sku</code> or <code>key</code> of the updated ProductVariant.</p>
101     */
102
103    public String getVariant() {
104        return this.variant;
105    }
106
107    public void setChange(final String change) {
108        this.change = change;
109    }
110
111    public void setPreviousValue(final com.commercetools.history.models.common.DiscountedLineItemPrice previousValue) {
112        this.previousValue = previousValue;
113    }
114
115    public void setNextValue(final com.commercetools.history.models.common.DiscountedLineItemPrice nextValue) {
116        this.nextValue = nextValue;
117    }
118
119    public void setLineItem(final com.commercetools.history.models.common.LocalizedString lineItem) {
120        this.lineItem = lineItem;
121    }
122
123    public void setVariant(final String variant) {
124        this.variant = variant;
125    }
126
127    @Override
128    public boolean equals(Object o) {
129        if (this == o)
130            return true;
131
132        if (o == null || getClass() != o.getClass())
133            return false;
134
135        SetLineItemDiscountedPriceChangeImpl that = (SetLineItemDiscountedPriceChangeImpl) o;
136
137        return new EqualsBuilder().append(type, that.type)
138                .append(change, that.change)
139                .append(previousValue, that.previousValue)
140                .append(nextValue, that.nextValue)
141                .append(lineItem, that.lineItem)
142                .append(variant, that.variant)
143                .append(type, that.type)
144                .append(change, that.change)
145                .append(previousValue, that.previousValue)
146                .append(nextValue, that.nextValue)
147                .append(lineItem, that.lineItem)
148                .append(variant, that.variant)
149                .isEquals();
150    }
151
152    @Override
153    public int hashCode() {
154        return new HashCodeBuilder(17, 37).append(type)
155                .append(change)
156                .append(previousValue)
157                .append(nextValue)
158                .append(lineItem)
159                .append(variant)
160                .toHashCode();
161    }
162
163}