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