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