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