001
002package com.commercetools.ml.models.similar_products;
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 *  <p>A set of ProductData for comparison. If no optional attributes are specified, all <code>current</code> ProductData are selected for comparison.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProductSetSelectorImpl implements ProductSetSelector, ModelBase {
022
023    private String projectKey;
024
025    private java.util.List<String> productIds;
026
027    private java.util.List<String> productTypeIds;
028
029    private Boolean staged;
030
031    private Boolean includeVariants;
032
033    private Long productSetLimit;
034
035    @JsonCreator
036    ProductSetSelectorImpl(@JsonProperty("projectKey") final String projectKey,
037            @JsonProperty("productIds") final java.util.List<String> productIds,
038            @JsonProperty("productTypeIds") final java.util.List<String> productTypeIds,
039            @JsonProperty("staged") final Boolean staged,
040            @JsonProperty("includeVariants") final Boolean includeVariants,
041            @JsonProperty("productSetLimit") final Long productSetLimit) {
042        this.projectKey = projectKey;
043        this.productIds = productIds;
044        this.productTypeIds = productTypeIds;
045        this.staged = staged;
046        this.includeVariants = includeVariants;
047        this.productSetLimit = productSetLimit;
048    }
049
050    public ProductSetSelectorImpl() {
051    }
052
053    /**
054     *  <p>The project containing the project set.</p>
055     */
056
057    public String getProjectKey() {
058        return this.projectKey;
059    }
060
061    /**
062     *  <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p>
063     */
064
065    public java.util.List<String> getProductIds() {
066        return this.productIds;
067    }
068
069    /**
070     *  <p>An array of product type IDs. Only products with product types in this array are compared. If unspecified, no product type filter is applied.</p>
071     */
072
073    public java.util.List<String> getProductTypeIds() {
074        return this.productTypeIds;
075    }
076
077    /**
078     *  <p>Specifies use of staged or current product data.</p>
079     */
080
081    public Boolean getStaged() {
082        return this.staged;
083    }
084
085    /**
086     *  <p>Specifies use of product variants. If set to <code>true</code>, all product variants are compared, not just the master variant.</p>
087     */
088
089    public Boolean getIncludeVariants() {
090        return this.includeVariants;
091    }
092
093    /**
094     *  <p>Maximum number of products to check (if unspecified, all products are considered). Note that the maximum number of product comparisons between two productSets is 20,000,000. This limit cannot be exceeded. If you need a higher limit, contact https://support.commercetools.com</p>
095     */
096
097    public Long getProductSetLimit() {
098        return this.productSetLimit;
099    }
100
101    public void setProjectKey(final String projectKey) {
102        this.projectKey = projectKey;
103    }
104
105    public void setProductIds(final String... productIds) {
106        this.productIds = new ArrayList<>(Arrays.asList(productIds));
107    }
108
109    public void setProductIds(final java.util.List<String> productIds) {
110        this.productIds = productIds;
111    }
112
113    public void setProductTypeIds(final String... productTypeIds) {
114        this.productTypeIds = new ArrayList<>(Arrays.asList(productTypeIds));
115    }
116
117    public void setProductTypeIds(final java.util.List<String> productTypeIds) {
118        this.productTypeIds = productTypeIds;
119    }
120
121    public void setStaged(final Boolean staged) {
122        this.staged = staged;
123    }
124
125    public void setIncludeVariants(final Boolean includeVariants) {
126        this.includeVariants = includeVariants;
127    }
128
129    public void setProductSetLimit(final Long productSetLimit) {
130        this.productSetLimit = productSetLimit;
131    }
132
133    @Override
134    public boolean equals(Object o) {
135        if (this == o)
136            return true;
137
138        if (o == null || getClass() != o.getClass())
139            return false;
140
141        ProductSetSelectorImpl that = (ProductSetSelectorImpl) o;
142
143        return new EqualsBuilder().append(projectKey, that.projectKey)
144                .append(productIds, that.productIds)
145                .append(productTypeIds, that.productTypeIds)
146                .append(staged, that.staged)
147                .append(includeVariants, that.includeVariants)
148                .append(productSetLimit, that.productSetLimit)
149                .isEquals();
150    }
151
152    @Override
153    public int hashCode() {
154        return new HashCodeBuilder(17, 37).append(projectKey)
155                .append(productIds)
156                .append(productTypeIds)
157                .append(staged)
158                .append(includeVariants)
159                .append(productSetLimit)
160                .toHashCode();
161    }
162
163}