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