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>Set Shipping Address on Orders.</li>
021 *   <li>Set Shipping Address on Staged Orders.</li>
022 *  </ul>
023 */
024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
025public class SetShippingAddressChangeImpl implements SetShippingAddressChange, ModelBase {
026
027    private String type;
028
029    private String change;
030
031    private com.commercetools.history.models.common.Address previousValue;
032
033    private com.commercetools.history.models.common.Address nextValue;
034
035    /**
036     * create instance with all properties
037     */
038    @JsonCreator
039    SetShippingAddressChangeImpl(@JsonProperty("change") final String change,
040            @JsonProperty("previousValue") final com.commercetools.history.models.common.Address previousValue,
041            @JsonProperty("nextValue") final com.commercetools.history.models.common.Address nextValue) {
042        this.change = change;
043        this.previousValue = previousValue;
044        this.nextValue = nextValue;
045        this.type = SET_SHIPPING_ADDRESS_CHANGE;
046    }
047
048    /**
049     * create empty instance
050     */
051    public SetShippingAddressChangeImpl() {
052        this.type = SET_SHIPPING_ADDRESS_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 com.commercetools.history.models.common.Address getPreviousValue() {
076        return this.previousValue;
077    }
078
079    /**
080     *  <p>Value after the change.</p>
081     */
082
083    public com.commercetools.history.models.common.Address 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.Address previousValue) {
092        this.previousValue = previousValue;
093    }
094
095    public void setNextValue(final com.commercetools.history.models.common.Address nextValue) {
096        this.nextValue = nextValue;
097    }
098
099    @Override
100    public boolean equals(Object o) {
101        if (this == o)
102            return true;
103
104        if (o == null || getClass() != o.getClass())
105            return false;
106
107        SetShippingAddressChangeImpl that = (SetShippingAddressChangeImpl) o;
108
109        return new EqualsBuilder().append(type, that.type)
110                .append(change, that.change)
111                .append(previousValue, that.previousValue)
112                .append(nextValue, that.nextValue)
113                .append(type, that.type)
114                .append(change, that.change)
115                .append(previousValue, that.previousValue)
116                .append(nextValue, that.nextValue)
117                .isEquals();
118    }
119
120    @Override
121    public int hashCode() {
122        return new HashCodeBuilder(17, 37).append(type)
123                .append(change)
124                .append(previousValue)
125                .append(nextValue)
126                .toHashCode();
127    }
128
129}