001
002package com.commercetools.history.models.change_value;
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 * ChangeTargetMultiBuyLineItemsChangeValue
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ChangeTargetMultiBuyLineItemsChangeValueImpl
022        implements ChangeTargetMultiBuyLineItemsChangeValue, ModelBase {
023
024    private String type;
025
026    private String predicate;
027
028    private Integer triggerQuantity;
029
030    private Integer discountedQuantity;
031
032    private Integer maxOccurrence;
033
034    private com.commercetools.history.models.common.SelectionMode selectionMode;
035
036    /**
037     * create instance with all properties
038     */
039    @JsonCreator
040    ChangeTargetMultiBuyLineItemsChangeValueImpl(@JsonProperty("predicate") final String predicate,
041            @JsonProperty("triggerQuantity") final Integer triggerQuantity,
042            @JsonProperty("discountedQuantity") final Integer discountedQuantity,
043            @JsonProperty("maxOccurrence") final Integer maxOccurrence,
044            @JsonProperty("selectionMode") final com.commercetools.history.models.common.SelectionMode selectionMode) {
045        this.predicate = predicate;
046        this.triggerQuantity = triggerQuantity;
047        this.discountedQuantity = discountedQuantity;
048        this.maxOccurrence = maxOccurrence;
049        this.selectionMode = selectionMode;
050        this.type = MULTI_BUY_LINE_ITEMS;
051    }
052
053    /**
054     * create empty instance
055     */
056    public ChangeTargetMultiBuyLineItemsChangeValueImpl() {
057        this.type = MULTI_BUY_LINE_ITEMS;
058    }
059
060    /**
061     *
062     */
063
064    public String getType() {
065        return this.type;
066    }
067
068    /**
069     *  <p>Valid LineItem target predicate.</p>
070     */
071
072    public String getPredicate() {
073        return this.predicate;
074    }
075
076    /**
077     *  <p>Quantity of Line Items that triggered the application of the discount.</p>
078     */
079
080    public Integer getTriggerQuantity() {
081        return this.triggerQuantity;
082    }
083
084    /**
085     *  <p>Quantity of Line Items discounted per application of this discount.</p>
086     */
087
088    public Integer getDiscountedQuantity() {
089        return this.discountedQuantity;
090    }
091
092    /**
093     *  <p>Maximum number of times the discount is applicable.</p>
094     */
095
096    public Integer getMaxOccurrence() {
097        return this.maxOccurrence;
098    }
099
100    /**
101     *  <p>SelectionMode based on which particular Line Items were discounted.</p>
102     */
103
104    public com.commercetools.history.models.common.SelectionMode getSelectionMode() {
105        return this.selectionMode;
106    }
107
108    public void setPredicate(final String predicate) {
109        this.predicate = predicate;
110    }
111
112    public void setTriggerQuantity(final Integer triggerQuantity) {
113        this.triggerQuantity = triggerQuantity;
114    }
115
116    public void setDiscountedQuantity(final Integer discountedQuantity) {
117        this.discountedQuantity = discountedQuantity;
118    }
119
120    public void setMaxOccurrence(final Integer maxOccurrence) {
121        this.maxOccurrence = maxOccurrence;
122    }
123
124    public void setSelectionMode(final com.commercetools.history.models.common.SelectionMode selectionMode) {
125        this.selectionMode = selectionMode;
126    }
127
128    @Override
129    public boolean equals(Object o) {
130        if (this == o)
131            return true;
132
133        if (o == null || getClass() != o.getClass())
134            return false;
135
136        ChangeTargetMultiBuyLineItemsChangeValueImpl that = (ChangeTargetMultiBuyLineItemsChangeValueImpl) o;
137
138        return new EqualsBuilder().append(type, that.type)
139                .append(predicate, that.predicate)
140                .append(triggerQuantity, that.triggerQuantity)
141                .append(discountedQuantity, that.discountedQuantity)
142                .append(maxOccurrence, that.maxOccurrence)
143                .append(selectionMode, that.selectionMode)
144                .append(type, that.type)
145                .append(predicate, that.predicate)
146                .append(triggerQuantity, that.triggerQuantity)
147                .append(discountedQuantity, that.discountedQuantity)
148                .append(maxOccurrence, that.maxOccurrence)
149                .append(selectionMode, that.selectionMode)
150                .isEquals();
151    }
152
153    @Override
154    public int hashCode() {
155        return new HashCodeBuilder(17, 37).append(type)
156                .append(predicate)
157                .append(triggerQuantity)
158                .append(discountedQuantity)
159                .append(maxOccurrence)
160                .append(selectionMode)
161                .toHashCode();
162    }
163
164}