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 the order of EnumValues update action.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ChangeEnumValueOrderChangeImpl implements ChangeEnumValueOrderChange, ModelBase {
022
023    private String type;
024
025    private String change;
026
027    private java.util.List<com.commercetools.history.models.change_value.EnumValue> previousValue;
028
029    private java.util.List<com.commercetools.history.models.change_value.EnumValue> nextValue;
030
031    private String fieldName;
032
033    /**
034     * create instance with all properties
035     */
036    @JsonCreator
037    ChangeEnumValueOrderChangeImpl(@JsonProperty("change") final String change,
038            @JsonProperty("previousValue") final java.util.List<com.commercetools.history.models.change_value.EnumValue> previousValue,
039            @JsonProperty("nextValue") final java.util.List<com.commercetools.history.models.change_value.EnumValue> nextValue,
040            @JsonProperty("fieldName") final String fieldName) {
041        this.change = change;
042        this.previousValue = previousValue;
043        this.nextValue = nextValue;
044        this.fieldName = fieldName;
045        this.type = CHANGE_ENUM_VALUE_ORDER_CHANGE;
046    }
047
048    /**
049     * create empty instance
050     */
051    public ChangeEnumValueOrderChangeImpl() {
052        this.type = CHANGE_ENUM_VALUE_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.change_value.EnumValue> 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.change_value.EnumValue> getNextValue() {
084        return this.nextValue;
085    }
086
087    /**
088     *  <p>Name of the updated FieldDefinition.</p>
089     */
090
091    public String getFieldName() {
092        return this.fieldName;
093    }
094
095    public void setChange(final String change) {
096        this.change = change;
097    }
098
099    public void setPreviousValue(final com.commercetools.history.models.change_value.EnumValue... previousValue) {
100        this.previousValue = new ArrayList<>(Arrays.asList(previousValue));
101    }
102
103    public void setPreviousValue(
104            final java.util.List<com.commercetools.history.models.change_value.EnumValue> previousValue) {
105        this.previousValue = previousValue;
106    }
107
108    public void setNextValue(final com.commercetools.history.models.change_value.EnumValue... nextValue) {
109        this.nextValue = new ArrayList<>(Arrays.asList(nextValue));
110    }
111
112    public void setNextValue(final java.util.List<com.commercetools.history.models.change_value.EnumValue> nextValue) {
113        this.nextValue = nextValue;
114    }
115
116    public void setFieldName(final String fieldName) {
117        this.fieldName = fieldName;
118    }
119
120    @Override
121    public boolean equals(Object o) {
122        if (this == o)
123            return true;
124
125        if (o == null || getClass() != o.getClass())
126            return false;
127
128        ChangeEnumValueOrderChangeImpl that = (ChangeEnumValueOrderChangeImpl) o;
129
130        return new EqualsBuilder().append(type, that.type)
131                .append(change, that.change)
132                .append(previousValue, that.previousValue)
133                .append(nextValue, that.nextValue)
134                .append(fieldName, that.fieldName)
135                .append(type, that.type)
136                .append(change, that.change)
137                .append(previousValue, that.previousValue)
138                .append(nextValue, that.nextValue)
139                .append(fieldName, that.fieldName)
140                .isEquals();
141    }
142
143    @Override
144    public int hashCode() {
145        return new HashCodeBuilder(17, 37).append(type)
146                .append(change)
147                .append(previousValue)
148                .append(nextValue)
149                .append(fieldName)
150                .toHashCode();
151    }
152
153}