001
002package com.commercetools.history.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 * ProductVariantSelection
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProductVariantSelectionImpl implements ProductVariantSelection, ModelBase {
022
023    private com.commercetools.history.models.common.ProductVariantSelectionTypeEnum type;
024
025    private java.util.List<String> skus;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    ProductVariantSelectionImpl(
032            @JsonProperty("type") final com.commercetools.history.models.common.ProductVariantSelectionTypeEnum type,
033            @JsonProperty("skus") final java.util.List<String> skus) {
034        this.type = type;
035        this.skus = skus;
036    }
037
038    /**
039     * create empty instance
040     */
041    public ProductVariantSelectionImpl() {
042    }
043
044    /**
045     *
046     */
047
048    public com.commercetools.history.models.common.ProductVariantSelectionTypeEnum getType() {
049        return this.type;
050    }
051
052    /**
053     *
054     */
055
056    public java.util.List<String> getSkus() {
057        return this.skus;
058    }
059
060    public void setType(final com.commercetools.history.models.common.ProductVariantSelectionTypeEnum type) {
061        this.type = type;
062    }
063
064    public void setSkus(final String... skus) {
065        this.skus = new ArrayList<>(Arrays.asList(skus));
066    }
067
068    public void setSkus(final java.util.List<String> skus) {
069        this.skus = skus;
070    }
071
072    @Override
073    public boolean equals(Object o) {
074        if (this == o)
075            return true;
076
077        if (o == null || getClass() != o.getClass())
078            return false;
079
080        ProductVariantSelectionImpl that = (ProductVariantSelectionImpl) o;
081
082        return new EqualsBuilder().append(type, that.type)
083                .append(skus, that.skus)
084                .append(type, that.type)
085                .append(skus, that.skus)
086                .isEquals();
087    }
088
089    @Override
090    public int hashCode() {
091        return new HashCodeBuilder(17, 37).append(type).append(skus).toHashCode();
092    }
093
094}