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