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>Change Asset Order on Categories.</li>
021 *   <li>Change Asset Order on Products.</li>
022 *  </ul>
023 */
024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
025public class ChangeAssetOrderChangeImpl implements ChangeAssetOrderChange, ModelBase {
026
027    private String type;
028
029    private String change;
030
031    private java.util.List<com.commercetools.history.models.common.LocalizedString> previousValue;
032
033    private java.util.List<com.commercetools.history.models.common.LocalizedString> nextValue;
034
035    /**
036     * create instance with all properties
037     */
038    @JsonCreator
039    ChangeAssetOrderChangeImpl(@JsonProperty("change") final String change,
040            @JsonProperty("previousValue") final java.util.List<com.commercetools.history.models.common.LocalizedString> previousValue,
041            @JsonProperty("nextValue") final java.util.List<com.commercetools.history.models.common.LocalizedString> nextValue) {
042        this.change = change;
043        this.previousValue = previousValue;
044        this.nextValue = nextValue;
045        this.type = CHANGE_ASSET_ORDER_CHANGE;
046    }
047
048    /**
049     * create empty instance
050     */
051    public ChangeAssetOrderChangeImpl() {
052        this.type = CHANGE_ASSET_ORDER_CHANGE;
053    }
054
055    /**
056     *
057     */
058
059    public String getType() {
060        return this.type;
061    }
062
063    /**
064     *
065     */
066
067    public String getChange() {
068        return this.change;
069    }
070
071    /**
072     *  <p>Value before the change.</p>
073     */
074
075    public java.util.List<com.commercetools.history.models.common.LocalizedString> getPreviousValue() {
076        return this.previousValue;
077    }
078
079    /**
080     *  <p>Value after the change.</p>
081     */
082
083    public java.util.List<com.commercetools.history.models.common.LocalizedString> getNextValue() {
084        return this.nextValue;
085    }
086
087    public void setChange(final String change) {
088        this.change = change;
089    }
090
091    public void setPreviousValue(final com.commercetools.history.models.common.LocalizedString... previousValue) {
092        this.previousValue = new ArrayList<>(Arrays.asList(previousValue));
093    }
094
095    public void setPreviousValue(
096            final java.util.List<com.commercetools.history.models.common.LocalizedString> previousValue) {
097        this.previousValue = previousValue;
098    }
099
100    public void setNextValue(final com.commercetools.history.models.common.LocalizedString... nextValue) {
101        this.nextValue = new ArrayList<>(Arrays.asList(nextValue));
102    }
103
104    public void setNextValue(final java.util.List<com.commercetools.history.models.common.LocalizedString> nextValue) {
105        this.nextValue = nextValue;
106    }
107
108    @Override
109    public boolean equals(Object o) {
110        if (this == o)
111            return true;
112
113        if (o == null || getClass() != o.getClass())
114            return false;
115
116        ChangeAssetOrderChangeImpl that = (ChangeAssetOrderChangeImpl) o;
117
118        return new EqualsBuilder().append(type, that.type)
119                .append(change, that.change)
120                .append(previousValue, that.previousValue)
121                .append(nextValue, that.nextValue)
122                .append(type, that.type)
123                .append(change, that.change)
124                .append(previousValue, that.previousValue)
125                .append(nextValue, that.nextValue)
126                .isEquals();
127    }
128
129    @Override
130    public int hashCode() {
131        return new HashCodeBuilder(17, 37).append(type)
132                .append(change)
133                .append(previousValue)
134                .append(nextValue)
135                .toHashCode();
136    }
137
138}