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