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