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