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>Remove Asset on Categories.</li>
021 *   <li>Remove Asset on Products.</li>
022 *  </ul>
023 */
024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
025public class RemoveAssetChangeImpl implements RemoveAssetChange, ModelBase {
026
027    private String type;
028
029    private String change;
030
031    private com.commercetools.history.models.common.Asset previousValue;
032
033    /**
034     * create instance with all properties
035     */
036    @JsonCreator
037    RemoveAssetChangeImpl(@JsonProperty("change") final String change,
038            @JsonProperty("previousValue") final com.commercetools.history.models.common.Asset previousValue) {
039        this.change = change;
040        this.previousValue = previousValue;
041        this.type = REMOVE_ASSET_CHANGE;
042    }
043
044    /**
045     * create empty instance
046     */
047    public RemoveAssetChangeImpl() {
048        this.type = REMOVE_ASSET_CHANGE;
049    }
050
051    /**
052     *
053     */
054
055    public String getType() {
056        return this.type;
057    }
058
059    /**
060     *
061     */
062
063    public String getChange() {
064        return this.change;
065    }
066
067    /**
068     *  <p>Value before the change.</p>
069     */
070
071    public com.commercetools.history.models.common.Asset getPreviousValue() {
072        return this.previousValue;
073    }
074
075    public void setChange(final String change) {
076        this.change = change;
077    }
078
079    public void setPreviousValue(final com.commercetools.history.models.common.Asset previousValue) {
080        this.previousValue = previousValue;
081    }
082
083    @Override
084    public boolean equals(Object o) {
085        if (this == o)
086            return true;
087
088        if (o == null || getClass() != o.getClass())
089            return false;
090
091        RemoveAssetChangeImpl that = (RemoveAssetChangeImpl) o;
092
093        return new EqualsBuilder().append(type, that.type)
094                .append(change, that.change)
095                .append(previousValue, that.previousValue)
096                .append(type, that.type)
097                .append(change, that.change)
098                .append(previousValue, that.previousValue)
099                .isEquals();
100    }
101
102    @Override
103    public int hashCode() {
104        return new HashCodeBuilder(17, 37).append(type).append(change).append(previousValue).toHashCode();
105    }
106
107}