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>Change Name on Cart Discounts.</li>
021 *   <li>Change Name on Categories.</li>
022 *   <li>Change Name on Channels.</li>
023 *   <li>Change Name on Customer Groups.</li>
024 *   <li>Change Name on Products.</li>
025 *   <li>Change Name on Product Discounts.</li>
026 *   <li>Change Name on Product Selections.</li>
027 *   <li>Change Name on Product Types.</li>
028 *   <li>Change Name on Shopping Lists.</li>
029 *   <li>Change Name on Tax Categories.</li>
030 *   <li>Change Name on Types.</li>
031 *   <li>Change Name on Zones.</li>
032 *  </ul>
033 */
034@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
035public class ChangeLocalizedNameChangeImpl implements ChangeLocalizedNameChange, ModelBase {
036
037    private String type;
038
039    private String change;
040
041    private com.commercetools.history.models.common.LocalizedString previousValue;
042
043    private com.commercetools.history.models.common.LocalizedString nextValue;
044
045    /**
046     * create instance with all properties
047     */
048    @JsonCreator
049    ChangeLocalizedNameChangeImpl(@JsonProperty("change") final String change,
050            @JsonProperty("previousValue") final com.commercetools.history.models.common.LocalizedString previousValue,
051            @JsonProperty("nextValue") final com.commercetools.history.models.common.LocalizedString nextValue) {
052        this.change = change;
053        this.previousValue = previousValue;
054        this.nextValue = nextValue;
055        this.type = CHANGE_LOCALIZED_NAME_CHANGE;
056    }
057
058    /**
059     * create empty instance
060     */
061    public ChangeLocalizedNameChangeImpl() {
062        this.type = CHANGE_LOCALIZED_NAME_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 com.commercetools.history.models.common.LocalizedString getPreviousValue() {
086        return this.previousValue;
087    }
088
089    /**
090     *  <p>Value after the change.</p>
091     */
092
093    public com.commercetools.history.models.common.LocalizedString 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 com.commercetools.history.models.common.LocalizedString previousValue) {
102        this.previousValue = previousValue;
103    }
104
105    public void setNextValue(final com.commercetools.history.models.common.LocalizedString 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        ChangeLocalizedNameChangeImpl that = (ChangeLocalizedNameChangeImpl) 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}