001
002package com.commercetools.api.models.order;
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 * ProductVariantImportDraft
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProductVariantImportDraftImpl implements ProductVariantImportDraft, ModelBase {
022
023    private Long id;
024
025    private String sku;
026
027    private java.util.List<com.commercetools.api.models.common.PriceDraft> prices;
028
029    private java.util.List<com.commercetools.api.models.product.Attribute> attributes;
030
031    private java.util.List<com.commercetools.api.models.common.Image> images;
032
033    /**
034     * create instance with all properties
035     */
036    @JsonCreator
037    ProductVariantImportDraftImpl(@JsonProperty("id") final Long id, @JsonProperty("sku") final String sku,
038            @JsonProperty("prices") final java.util.List<com.commercetools.api.models.common.PriceDraft> prices,
039            @JsonProperty("attributes") final java.util.List<com.commercetools.api.models.product.Attribute> attributes,
040            @JsonProperty("images") final java.util.List<com.commercetools.api.models.common.Image> images) {
041        this.id = id;
042        this.sku = sku;
043        this.prices = prices;
044        this.attributes = attributes;
045        this.images = images;
046    }
047
048    /**
049     * create empty instance
050     */
051    public ProductVariantImportDraftImpl() {
052    }
053
054    /**
055     *  <p>The sequential ID of the variant within the product. The variant with provided ID should exist in some existing product, so you also need to specify the productId if this property is set, or alternatively you can just specify SKU of the product variant.</p>
056     */
057
058    public Long getId() {
059        return this.id;
060    }
061
062    /**
063     *  <p>The SKU of the existing variant.</p>
064     */
065
066    public String getSku() {
067        return this.sku;
068    }
069
070    /**
071     *  <p>The Embedded Prices of the variant. The prices should not contain two prices for the same price scope (same currency, country, customer group, channel, valid from and valid until). If this property is defined, then it will override the <code>prices</code> property from the original product variant, otherwise <code>prices</code> property from the original product variant would be copied in the resulting order.</p>
072     */
073
074    public java.util.List<com.commercetools.api.models.common.PriceDraft> getPrices() {
075        return this.prices;
076    }
077
078    /**
079     *  <p>If this property is defined, then it will override the <code>attributes</code> property from the original product variant, otherwise <code>attributes</code> property from the original product variant would be copied in the resulting order.</p>
080     */
081
082    public java.util.List<com.commercetools.api.models.product.Attribute> getAttributes() {
083        return this.attributes;
084    }
085
086    /**
087     *  <p>If this property is defined, then it will override the <code>images</code> property from the original product variant, otherwise <code>images</code> property from the original product variant would be copied in the resulting order.</p>
088     */
089
090    public java.util.List<com.commercetools.api.models.common.Image> getImages() {
091        return this.images;
092    }
093
094    public void setId(final Long id) {
095        this.id = id;
096    }
097
098    public void setSku(final String sku) {
099        this.sku = sku;
100    }
101
102    public void setPrices(final com.commercetools.api.models.common.PriceDraft... prices) {
103        this.prices = new ArrayList<>(Arrays.asList(prices));
104    }
105
106    public void setPrices(final java.util.List<com.commercetools.api.models.common.PriceDraft> prices) {
107        this.prices = prices;
108    }
109
110    public void setAttributes(final com.commercetools.api.models.product.Attribute... attributes) {
111        this.attributes = new ArrayList<>(Arrays.asList(attributes));
112    }
113
114    public void setAttributes(final java.util.List<com.commercetools.api.models.product.Attribute> attributes) {
115        this.attributes = attributes;
116    }
117
118    public void setImages(final com.commercetools.api.models.common.Image... images) {
119        this.images = new ArrayList<>(Arrays.asList(images));
120    }
121
122    public void setImages(final java.util.List<com.commercetools.api.models.common.Image> images) {
123        this.images = images;
124    }
125
126    @Override
127    public boolean equals(Object o) {
128        if (this == o)
129            return true;
130
131        if (o == null || getClass() != o.getClass())
132            return false;
133
134        ProductVariantImportDraftImpl that = (ProductVariantImportDraftImpl) o;
135
136        return new EqualsBuilder().append(id, that.id)
137                .append(sku, that.sku)
138                .append(prices, that.prices)
139                .append(attributes, that.attributes)
140                .append(images, that.images)
141                .isEquals();
142    }
143
144    @Override
145    public int hashCode() {
146        return new HashCodeBuilder(17, 37).append(id)
147                .append(sku)
148                .append(prices)
149                .append(attributes)
150                .append(images)
151                .toHashCode();
152    }
153
154}