001
002package com.commercetools.api.models.common;
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 * QueryPrice
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class QueryPriceImpl implements QueryPrice, ModelBase {
022
023    private String id;
024
025    private com.commercetools.api.models.common.Money value;
026
027    private String country;
028
029    private com.commercetools.api.models.customer_group.CustomerGroupReference customerGroup;
030
031    private com.commercetools.api.models.channel.ChannelReference channel;
032
033    private java.time.ZonedDateTime validFrom;
034
035    private java.time.ZonedDateTime validUntil;
036
037    private com.commercetools.api.models.common.DiscountedPriceDraft discounted;
038
039    private com.commercetools.api.models.type.CustomFields custom;
040
041    private java.util.List<com.commercetools.api.models.common.PriceTierDraft> tiers;
042
043    /**
044     * create instance with all properties
045     */
046    @JsonCreator
047    QueryPriceImpl(@JsonProperty("id") final String id,
048            @JsonProperty("value") final com.commercetools.api.models.common.Money value,
049            @JsonProperty("country") final String country,
050            @JsonProperty("customerGroup") final com.commercetools.api.models.customer_group.CustomerGroupReference customerGroup,
051            @JsonProperty("channel") final com.commercetools.api.models.channel.ChannelReference channel,
052            @JsonProperty("validFrom") final java.time.ZonedDateTime validFrom,
053            @JsonProperty("validUntil") final java.time.ZonedDateTime validUntil,
054            @JsonProperty("discounted") final com.commercetools.api.models.common.DiscountedPriceDraft discounted,
055            @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom,
056            @JsonProperty("tiers") final java.util.List<com.commercetools.api.models.common.PriceTierDraft> tiers) {
057        this.id = id;
058        this.value = value;
059        this.country = country;
060        this.customerGroup = customerGroup;
061        this.channel = channel;
062        this.validFrom = validFrom;
063        this.validUntil = validUntil;
064        this.discounted = discounted;
065        this.custom = custom;
066        this.tiers = tiers;
067    }
068
069    /**
070     * create empty instance
071     */
072    public QueryPriceImpl() {
073    }
074
075    /**
076     *  <p>Unique identifier of the given Price.</p>
077     */
078
079    public String getId() {
080        return this.id;
081    }
082
083    /**
084     *  <p>Money value of the given Price.</p>
085     */
086
087    public com.commercetools.api.models.common.Money getValue() {
088        return this.value;
089    }
090
091    /**
092     *  <p>Country for which the given Price is valid.</p>
093     */
094
095    public String getCountry() {
096        return this.country;
097    }
098
099    /**
100     *  <p>CustomerGroup for which the given Price is valid.</p>
101     */
102
103    public com.commercetools.api.models.customer_group.CustomerGroupReference getCustomerGroup() {
104        return this.customerGroup;
105    }
106
107    /**
108     *  <p><code>ProductDistribution</code> Channel for which the given Price is valid.</p>
109     */
110
111    public com.commercetools.api.models.channel.ChannelReference getChannel() {
112        return this.channel;
113    }
114
115    /**
116     *  <p>Date from which the given Price is valid.</p>
117     */
118
119    public java.time.ZonedDateTime getValidFrom() {
120        return this.validFrom;
121    }
122
123    /**
124     *  <p>Date until which the given Price is valid.</p>
125     */
126
127    public java.time.ZonedDateTime getValidUntil() {
128        return this.validUntil;
129    }
130
131    /**
132     *  <p>DiscountedPrice you specify for the given Price.</p>
133     */
134
135    public com.commercetools.api.models.common.DiscountedPriceDraft getDiscounted() {
136        return this.discounted;
137    }
138
139    /**
140     *  <p>Custom Fields for the Price.</p>
141     */
142
143    public com.commercetools.api.models.type.CustomFields getCustom() {
144        return this.custom;
145    }
146
147    /**
148     *  <p>Price tier applied when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.</p>
149     */
150
151    public java.util.List<com.commercetools.api.models.common.PriceTierDraft> getTiers() {
152        return this.tiers;
153    }
154
155    public void setId(final String id) {
156        this.id = id;
157    }
158
159    public void setValue(final com.commercetools.api.models.common.Money value) {
160        this.value = value;
161    }
162
163    public void setCountry(final String country) {
164        this.country = country;
165    }
166
167    public void setCustomerGroup(
168            final com.commercetools.api.models.customer_group.CustomerGroupReference customerGroup) {
169        this.customerGroup = customerGroup;
170    }
171
172    public void setChannel(final com.commercetools.api.models.channel.ChannelReference channel) {
173        this.channel = channel;
174    }
175
176    public void setValidFrom(final java.time.ZonedDateTime validFrom) {
177        this.validFrom = validFrom;
178    }
179
180    public void setValidUntil(final java.time.ZonedDateTime validUntil) {
181        this.validUntil = validUntil;
182    }
183
184    public void setDiscounted(final com.commercetools.api.models.common.DiscountedPriceDraft discounted) {
185        this.discounted = discounted;
186    }
187
188    public void setCustom(final com.commercetools.api.models.type.CustomFields custom) {
189        this.custom = custom;
190    }
191
192    public void setTiers(final com.commercetools.api.models.common.PriceTierDraft... tiers) {
193        this.tiers = new ArrayList<>(Arrays.asList(tiers));
194    }
195
196    public void setTiers(final java.util.List<com.commercetools.api.models.common.PriceTierDraft> tiers) {
197        this.tiers = tiers;
198    }
199
200    @Override
201    public boolean equals(Object o) {
202        if (this == o)
203            return true;
204
205        if (o == null || getClass() != o.getClass())
206            return false;
207
208        QueryPriceImpl that = (QueryPriceImpl) o;
209
210        return new EqualsBuilder().append(id, that.id)
211                .append(value, that.value)
212                .append(country, that.country)
213                .append(customerGroup, that.customerGroup)
214                .append(channel, that.channel)
215                .append(validFrom, that.validFrom)
216                .append(validUntil, that.validUntil)
217                .append(discounted, that.discounted)
218                .append(custom, that.custom)
219                .append(tiers, that.tiers)
220                .isEquals();
221    }
222
223    @Override
224    public int hashCode() {
225        return new HashCodeBuilder(17, 37).append(id)
226                .append(value)
227                .append(country)
228                .append(customerGroup)
229                .append(channel)
230                .append(validFrom)
231                .append(validUntil)
232                .append(discounted)
233                .append(custom)
234                .append(tiers)
235                .toHashCode();
236    }
237
238}