001
002package com.commercetools.importapi.models.orders;
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 * CustomLineItemDraft
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class CustomLineItemDraftImpl implements CustomLineItemDraft, ModelBase {
022
023    private com.commercetools.importapi.models.common.LocalizedString name;
024
025    private com.commercetools.importapi.models.common.TypedMoney money;
026
027    private com.commercetools.importapi.models.orders.CustomLineItemTaxedPrice taxedPrice;
028
029    private com.commercetools.importapi.models.common.TypedMoney totalPrice;
030
031    private String slug;
032
033    private Double quantity;
034
035    private java.util.List<com.commercetools.importapi.models.orders.ItemState> state;
036
037    private com.commercetools.importapi.models.common.TaxCategoryKeyReference taxCategory;
038
039    private com.commercetools.importapi.models.prices.TaxRate taxRate;
040
041    private com.commercetools.importapi.models.orders.ExternalTaxRateDraft externalTaxRate;
042
043    private java.util.List<com.commercetools.importapi.models.orders.DiscountedLineItemPriceDraft> discountedPricePerQuantity;
044
045    private com.commercetools.importapi.models.orders.ItemShippingDetailsDraft shippingDetails;
046
047    /**
048     * create instance with all properties
049     */
050    @JsonCreator
051    CustomLineItemDraftImpl(@JsonProperty("name") final com.commercetools.importapi.models.common.LocalizedString name,
052            @JsonProperty("money") final com.commercetools.importapi.models.common.TypedMoney money,
053            @JsonProperty("taxedPrice") final com.commercetools.importapi.models.orders.CustomLineItemTaxedPrice taxedPrice,
054            @JsonProperty("totalPrice") final com.commercetools.importapi.models.common.TypedMoney totalPrice,
055            @JsonProperty("slug") final String slug, @JsonProperty("quantity") final Double quantity,
056            @JsonProperty("state") final java.util.List<com.commercetools.importapi.models.orders.ItemState> state,
057            @JsonProperty("taxCategory") final com.commercetools.importapi.models.common.TaxCategoryKeyReference taxCategory,
058            @JsonProperty("taxRate") final com.commercetools.importapi.models.prices.TaxRate taxRate,
059            @JsonProperty("externalTaxRate") final com.commercetools.importapi.models.orders.ExternalTaxRateDraft externalTaxRate,
060            @JsonProperty("discountedPricePerQuantity") final java.util.List<com.commercetools.importapi.models.orders.DiscountedLineItemPriceDraft> discountedPricePerQuantity,
061            @JsonProperty("shippingDetails") final com.commercetools.importapi.models.orders.ItemShippingDetailsDraft shippingDetails) {
062        this.name = name;
063        this.money = money;
064        this.taxedPrice = taxedPrice;
065        this.totalPrice = totalPrice;
066        this.slug = slug;
067        this.quantity = quantity;
068        this.state = state;
069        this.taxCategory = taxCategory;
070        this.taxRate = taxRate;
071        this.externalTaxRate = externalTaxRate;
072        this.discountedPricePerQuantity = discountedPricePerQuantity;
073        this.shippingDetails = shippingDetails;
074    }
075
076    /**
077     * create empty instance
078     */
079    public CustomLineItemDraftImpl() {
080    }
081
082    /**
083     *  <p>A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.</p>
084     *  <pre><code>{
085     *    "de": "Hundefutter",
086     *    "en": "dog food"
087     *  }
088     *  </code></pre>
089     */
090
091    public com.commercetools.importapi.models.common.LocalizedString getName() {
092        return this.name;
093    }
094
095    /**
096     *
097     */
098
099    public com.commercetools.importapi.models.common.TypedMoney getMoney() {
100        return this.money;
101    }
102
103    /**
104     *
105     */
106
107    public com.commercetools.importapi.models.orders.CustomLineItemTaxedPrice getTaxedPrice() {
108        return this.taxedPrice;
109    }
110
111    /**
112     *
113     */
114
115    public com.commercetools.importapi.models.common.TypedMoney getTotalPrice() {
116        return this.totalPrice;
117    }
118
119    /**
120     *
121     */
122
123    public String getSlug() {
124        return this.slug;
125    }
126
127    /**
128     *
129     */
130
131    public Double getQuantity() {
132        return this.quantity;
133    }
134
135    /**
136     *
137     */
138
139    public java.util.List<com.commercetools.importapi.models.orders.ItemState> getState() {
140        return this.state;
141    }
142
143    /**
144     *  <p>References a tax category by key.</p>
145     */
146
147    public com.commercetools.importapi.models.common.TaxCategoryKeyReference getTaxCategory() {
148        return this.taxCategory;
149    }
150
151    /**
152     *
153     */
154
155    public com.commercetools.importapi.models.prices.TaxRate getTaxRate() {
156        return this.taxRate;
157    }
158
159    /**
160     *
161     */
162
163    public com.commercetools.importapi.models.orders.ExternalTaxRateDraft getExternalTaxRate() {
164        return this.externalTaxRate;
165    }
166
167    /**
168     *
169     */
170
171    public java.util.List<com.commercetools.importapi.models.orders.DiscountedLineItemPriceDraft> getDiscountedPricePerQuantity() {
172        return this.discountedPricePerQuantity;
173    }
174
175    /**
176     *
177     */
178
179    public com.commercetools.importapi.models.orders.ItemShippingDetailsDraft getShippingDetails() {
180        return this.shippingDetails;
181    }
182
183    public void setName(final com.commercetools.importapi.models.common.LocalizedString name) {
184        this.name = name;
185    }
186
187    public void setMoney(final com.commercetools.importapi.models.common.TypedMoney money) {
188        this.money = money;
189    }
190
191    public void setTaxedPrice(final com.commercetools.importapi.models.orders.CustomLineItemTaxedPrice taxedPrice) {
192        this.taxedPrice = taxedPrice;
193    }
194
195    public void setTotalPrice(final com.commercetools.importapi.models.common.TypedMoney totalPrice) {
196        this.totalPrice = totalPrice;
197    }
198
199    public void setSlug(final String slug) {
200        this.slug = slug;
201    }
202
203    public void setQuantity(final Double quantity) {
204        this.quantity = quantity;
205    }
206
207    public void setState(final com.commercetools.importapi.models.orders.ItemState... state) {
208        this.state = new ArrayList<>(Arrays.asList(state));
209    }
210
211    public void setState(final java.util.List<com.commercetools.importapi.models.orders.ItemState> state) {
212        this.state = state;
213    }
214
215    public void setTaxCategory(final com.commercetools.importapi.models.common.TaxCategoryKeyReference taxCategory) {
216        this.taxCategory = taxCategory;
217    }
218
219    public void setTaxRate(final com.commercetools.importapi.models.prices.TaxRate taxRate) {
220        this.taxRate = taxRate;
221    }
222
223    public void setExternalTaxRate(
224            final com.commercetools.importapi.models.orders.ExternalTaxRateDraft externalTaxRate) {
225        this.externalTaxRate = externalTaxRate;
226    }
227
228    public void setDiscountedPricePerQuantity(
229            final com.commercetools.importapi.models.orders.DiscountedLineItemPriceDraft... discountedPricePerQuantity) {
230        this.discountedPricePerQuantity = new ArrayList<>(Arrays.asList(discountedPricePerQuantity));
231    }
232
233    public void setDiscountedPricePerQuantity(
234            final java.util.List<com.commercetools.importapi.models.orders.DiscountedLineItemPriceDraft> discountedPricePerQuantity) {
235        this.discountedPricePerQuantity = discountedPricePerQuantity;
236    }
237
238    public void setShippingDetails(
239            final com.commercetools.importapi.models.orders.ItemShippingDetailsDraft shippingDetails) {
240        this.shippingDetails = shippingDetails;
241    }
242
243    @Override
244    public boolean equals(Object o) {
245        if (this == o)
246            return true;
247
248        if (o == null || getClass() != o.getClass())
249            return false;
250
251        CustomLineItemDraftImpl that = (CustomLineItemDraftImpl) o;
252
253        return new EqualsBuilder().append(name, that.name)
254                .append(money, that.money)
255                .append(taxedPrice, that.taxedPrice)
256                .append(totalPrice, that.totalPrice)
257                .append(slug, that.slug)
258                .append(quantity, that.quantity)
259                .append(state, that.state)
260                .append(taxCategory, that.taxCategory)
261                .append(taxRate, that.taxRate)
262                .append(externalTaxRate, that.externalTaxRate)
263                .append(discountedPricePerQuantity, that.discountedPricePerQuantity)
264                .append(shippingDetails, that.shippingDetails)
265                .append(name, that.name)
266                .append(money, that.money)
267                .append(taxedPrice, that.taxedPrice)
268                .append(totalPrice, that.totalPrice)
269                .append(slug, that.slug)
270                .append(quantity, that.quantity)
271                .append(state, that.state)
272                .append(taxCategory, that.taxCategory)
273                .append(taxRate, that.taxRate)
274                .append(externalTaxRate, that.externalTaxRate)
275                .append(discountedPricePerQuantity, that.discountedPricePerQuantity)
276                .append(shippingDetails, that.shippingDetails)
277                .isEquals();
278    }
279
280    @Override
281    public int hashCode() {
282        return new HashCodeBuilder(17, 37).append(name)
283                .append(money)
284                .append(taxedPrice)
285                .append(totalPrice)
286                .append(slug)
287                .append(quantity)
288                .append(state)
289                .append(taxCategory)
290                .append(taxRate)
291                .append(externalTaxRate)
292                .append(discountedPricePerQuantity)
293                .append(shippingDetails)
294                .toHashCode();
295    }
296
297}