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 CustomLineItem CustomField on Orders.</li>
021 *   <li>Set CustomLineItem CustomField 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 SetCustomLineItemCustomTypeChangeImpl implements SetCustomLineItemCustomTypeChange, 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 customLineItem;
036
037    private String customLineItemId;
038
039    /**
040     * create instance with all properties
041     */
042    @JsonCreator
043    SetCustomLineItemCustomTypeChangeImpl(@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("customLineItem") final com.commercetools.history.models.common.LocalizedString customLineItem,
047            @JsonProperty("customLineItemId") final String customLineItemId) {
048        this.change = change;
049        this.previousValue = previousValue;
050        this.nextValue = nextValue;
051        this.customLineItem = customLineItem;
052        this.customLineItemId = customLineItemId;
053        this.type = SET_CUSTOM_LINE_ITEM_CUSTOM_TYPE_CHANGE;
054    }
055
056    /**
057     * create empty instance
058     */
059    public SetCustomLineItemCustomTypeChangeImpl() {
060        this.type = SET_CUSTOM_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 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    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 setCustomLineItem(final com.commercetools.history.models.common.LocalizedString customLineItem) {
124        this.customLineItem = customLineItem;
125    }
126
127    public void setCustomLineItemId(final String customLineItemId) {
128        this.customLineItemId = customLineItemId;
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        SetCustomLineItemCustomTypeChangeImpl that = (SetCustomLineItemCustomTypeChangeImpl) 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(customLineItem, that.customLineItem)
146                .append(customLineItemId, that.customLineItemId)
147                .append(type, that.type)
148                .append(change, that.change)
149                .append(previousValue, that.previousValue)
150                .append(nextValue, that.nextValue)
151                .append(customLineItem, that.customLineItem)
152                .append(customLineItemId, that.customLineItemId)
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(customLineItem)
163                .append(customLineItemId)
164                .toHashCode();
165    }
166
167}