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