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>Difference between the previous and next version of a resource represented by <code>previousValue</code> (omitted, for example, on creations) and <code>nextValue</code> of the associated change. A Change can also contain extra fields that provide further information.</p>
019 *  <p>They are not identical to the actual update actions sent.</p>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class ChangeImpl implements Change, ModelBase {
023
024    private String type;
025
026    private String change;
027
028    /**
029     * create instance with all properties
030     */
031    @JsonCreator
032    ChangeImpl(@JsonProperty("type") final String type, @JsonProperty("change") final String change) {
033        this.type = type;
034        this.change = change;
035    }
036
037    /**
038     * create empty instance
039     */
040    public ChangeImpl() {
041    }
042
043    /**
044     *  <p>Unique discriminator value to reliably deserialize the data type.</p>
045     */
046
047    public String getType() {
048        return this.type;
049    }
050
051    /**
052     *  <p>Type of change on a resource that is similar to the update action it relates to, where possible. It is not a unique identifier for the data structure, for example, the <code>setDescription</code> change can occur with a localized and non-localized representation.</p>
053     *  <p>Records can be filtered by this value using the <code>changes</code> query parameter.</p>
054     */
055
056    public String getChange() {
057        return this.change;
058    }
059
060    public void setChange(final String change) {
061        this.change = change;
062    }
063
064    @Override
065    public boolean equals(Object o) {
066        if (this == o)
067            return true;
068
069        if (o == null || getClass() != o.getClass())
070            return false;
071
072        ChangeImpl that = (ChangeImpl) o;
073
074        return new EqualsBuilder().append(type, that.type)
075                .append(change, that.change)
076                .append(type, that.type)
077                .append(change, that.change)
078                .isEquals();
079    }
080
081    @Override
082    public int hashCode() {
083        return new HashCodeBuilder(17, 37).append(type).append(change).toHashCode();
084    }
085
086}