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 Set Address Custom Field update action.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class SetAddressCustomFieldChangeImpl implements SetAddressCustomFieldChange, ModelBase {
022
023    private String type;
024
025    private String change;
026
027    private com.commercetools.history.models.common.Address address;
028
029    private String name;
030
031    private String customTypeId;
032
033    private java.lang.Object previousValue;
034
035    private java.lang.Object nextValue;
036
037    /**
038     * create instance with all properties
039     */
040    @JsonCreator
041    SetAddressCustomFieldChangeImpl(@JsonProperty("change") final String change,
042            @JsonProperty("address") final com.commercetools.history.models.common.Address address,
043            @JsonProperty("name") final String name, @JsonProperty("customTypeId") final String customTypeId,
044            @JsonProperty("previousValue") final java.lang.Object previousValue,
045            @JsonProperty("nextValue") final java.lang.Object nextValue) {
046        this.change = change;
047        this.address = address;
048        this.name = name;
049        this.customTypeId = customTypeId;
050        this.previousValue = previousValue;
051        this.nextValue = nextValue;
052        this.type = SET_ADDRESS_CUSTOM_FIELD_CHANGE;
053    }
054
055    /**
056     * create empty instance
057     */
058    public SetAddressCustomFieldChangeImpl() {
059        this.type = SET_ADDRESS_CUSTOM_FIELD_CHANGE;
060    }
061
062    /**
063     *
064     */
065
066    public String getType() {
067        return this.type;
068    }
069
070    /**
071     *
072     */
073
074    public String getChange() {
075        return this.change;
076    }
077
078    /**
079     *  <p>Address which was extended.</p>
080     */
081
082    public com.commercetools.history.models.common.Address getAddress() {
083        return this.address;
084    }
085
086    /**
087     *  <p>Name of the Custom Field.</p>
088     */
089
090    public String getName() {
091        return this.name;
092    }
093
094    /**
095     *  <p><code>id</code> of the referenced Type.</p>
096     */
097
098    public String getCustomTypeId() {
099        return this.customTypeId;
100    }
101
102    /**
103     *  <p>Value before the change.</p>
104     */
105
106    public java.lang.Object getPreviousValue() {
107        return this.previousValue;
108    }
109
110    /**
111     *  <p>Value after the change.</p>
112     */
113
114    public java.lang.Object getNextValue() {
115        return this.nextValue;
116    }
117
118    public void setChange(final String change) {
119        this.change = change;
120    }
121
122    public void setAddress(final com.commercetools.history.models.common.Address address) {
123        this.address = address;
124    }
125
126    public void setName(final String name) {
127        this.name = name;
128    }
129
130    public void setCustomTypeId(final String customTypeId) {
131        this.customTypeId = customTypeId;
132    }
133
134    public void setPreviousValue(final java.lang.Object previousValue) {
135        this.previousValue = previousValue;
136    }
137
138    public void setNextValue(final java.lang.Object nextValue) {
139        this.nextValue = nextValue;
140    }
141
142    @Override
143    public boolean equals(Object o) {
144        if (this == o)
145            return true;
146
147        if (o == null || getClass() != o.getClass())
148            return false;
149
150        SetAddressCustomFieldChangeImpl that = (SetAddressCustomFieldChangeImpl) o;
151
152        return new EqualsBuilder().append(type, that.type)
153                .append(change, that.change)
154                .append(address, that.address)
155                .append(name, that.name)
156                .append(customTypeId, that.customTypeId)
157                .append(previousValue, that.previousValue)
158                .append(nextValue, that.nextValue)
159                .append(type, that.type)
160                .append(change, that.change)
161                .append(address, that.address)
162                .append(name, that.name)
163                .append(customTypeId, that.customTypeId)
164                .append(previousValue, that.previousValue)
165                .append(nextValue, that.nextValue)
166                .isEquals();
167    }
168
169    @Override
170    public int hashCode() {
171        return new HashCodeBuilder(17, 37).append(type)
172                .append(change)
173                .append(address)
174                .append(name)
175                .append(customTypeId)
176                .append(previousValue)
177                .append(nextValue)
178                .toHashCode();
179    }
180
181}