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