001
002package com.commercetools.ml.models.similar_products;
003
004import java.util.*;
005
006import javax.annotation.Nullable;
007
008import io.vrap.rmf.base.client.Builder;
009import io.vrap.rmf.base.client.utils.Generated;
010
011/**
012 * ProductSetSelectorBuilder
013 * <hr>
014 * Example to create an instance using the builder pattern
015 * <div class=code-example>
016 * <pre><code class='java'>
017 *     ProductSetSelector productSetSelector = ProductSetSelector.builder()
018 *             .projectKey("{projectKey}")
019 *             .build()
020 * </code></pre>
021 * </div>
022 */
023@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
024public class ProductSetSelectorBuilder implements Builder<ProductSetSelector> {
025
026    private String projectKey;
027
028    @Nullable
029    private java.util.List<String> productIds;
030
031    @Nullable
032    private java.util.List<String> productTypeIds;
033
034    @Nullable
035    private Boolean staged;
036
037    @Nullable
038    private Boolean includeVariants;
039
040    @Nullable
041    private Long productSetLimit;
042
043    /**
044     *  <p>The project containing the project set.</p>
045     * @param projectKey value to be set
046     * @return Builder
047     */
048
049    public ProductSetSelectorBuilder projectKey(final String projectKey) {
050        this.projectKey = projectKey;
051        return this;
052    }
053
054    /**
055     *  <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p>
056     * @param productIds value to be set
057     * @return Builder
058     */
059
060    public ProductSetSelectorBuilder productIds(@Nullable final String... productIds) {
061        this.productIds = new ArrayList<>(Arrays.asList(productIds));
062        return this;
063    }
064
065    /**
066     *  <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p>
067     * @param productIds value to be set
068     * @return Builder
069     */
070
071    public ProductSetSelectorBuilder productIds(@Nullable final java.util.List<String> productIds) {
072        this.productIds = productIds;
073        return this;
074    }
075
076    /**
077     *  <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p>
078     * @param productIds value to be set
079     * @return Builder
080     */
081
082    public ProductSetSelectorBuilder plusProductIds(@Nullable final String... productIds) {
083        if (this.productIds == null) {
084            this.productIds = new ArrayList<>();
085        }
086        this.productIds.addAll(Arrays.asList(productIds));
087        return this;
088    }
089
090    /**
091     *  <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>
092     * @param productTypeIds value to be set
093     * @return Builder
094     */
095
096    public ProductSetSelectorBuilder productTypeIds(@Nullable final String... productTypeIds) {
097        this.productTypeIds = new ArrayList<>(Arrays.asList(productTypeIds));
098        return this;
099    }
100
101    /**
102     *  <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>
103     * @param productTypeIds value to be set
104     * @return Builder
105     */
106
107    public ProductSetSelectorBuilder productTypeIds(@Nullable final java.util.List<String> productTypeIds) {
108        this.productTypeIds = productTypeIds;
109        return this;
110    }
111
112    /**
113     *  <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>
114     * @param productTypeIds value to be set
115     * @return Builder
116     */
117
118    public ProductSetSelectorBuilder plusProductTypeIds(@Nullable final String... productTypeIds) {
119        if (this.productTypeIds == null) {
120            this.productTypeIds = new ArrayList<>();
121        }
122        this.productTypeIds.addAll(Arrays.asList(productTypeIds));
123        return this;
124    }
125
126    /**
127     *  <p>Specifies use of staged or current product data.</p>
128     * @param staged value to be set
129     * @return Builder
130     */
131
132    public ProductSetSelectorBuilder staged(@Nullable final Boolean staged) {
133        this.staged = staged;
134        return this;
135    }
136
137    /**
138     *  <p>Specifies use of product variants. If set to <code>true</code>, all product variants are compared, not just the master variant.</p>
139     * @param includeVariants value to be set
140     * @return Builder
141     */
142
143    public ProductSetSelectorBuilder includeVariants(@Nullable final Boolean includeVariants) {
144        this.includeVariants = includeVariants;
145        return this;
146    }
147
148    /**
149     *  <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>
150     * @param productSetLimit value to be set
151     * @return Builder
152     */
153
154    public ProductSetSelectorBuilder productSetLimit(@Nullable final Long productSetLimit) {
155        this.productSetLimit = productSetLimit;
156        return this;
157    }
158
159    /**
160     *  <p>The project containing the project set.</p>
161     * @return projectKey
162     */
163
164    public String getProjectKey() {
165        return this.projectKey;
166    }
167
168    /**
169     *  <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p>
170     * @return productIds
171     */
172
173    @Nullable
174    public java.util.List<String> getProductIds() {
175        return this.productIds;
176    }
177
178    /**
179     *  <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>
180     * @return productTypeIds
181     */
182
183    @Nullable
184    public java.util.List<String> getProductTypeIds() {
185        return this.productTypeIds;
186    }
187
188    /**
189     *  <p>Specifies use of staged or current product data.</p>
190     * @return staged
191     */
192
193    @Nullable
194    public Boolean getStaged() {
195        return this.staged;
196    }
197
198    /**
199     *  <p>Specifies use of product variants. If set to <code>true</code>, all product variants are compared, not just the master variant.</p>
200     * @return includeVariants
201     */
202
203    @Nullable
204    public Boolean getIncludeVariants() {
205        return this.includeVariants;
206    }
207
208    /**
209     *  <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>
210     * @return productSetLimit
211     */
212
213    @Nullable
214    public Long getProductSetLimit() {
215        return this.productSetLimit;
216    }
217
218    /**
219     * builds ProductSetSelector with checking for non-null required values
220     * @return ProductSetSelector
221     */
222    public ProductSetSelector build() {
223        Objects.requireNonNull(projectKey, ProductSetSelector.class + ": projectKey is missing");
224        return new ProductSetSelectorImpl(projectKey, productIds, productTypeIds, staged, includeVariants,
225            productSetLimit);
226    }
227
228    /**
229     * builds ProductSetSelector without checking for non-null required values
230     * @return ProductSetSelector
231     */
232    public ProductSetSelector buildUnchecked() {
233        return new ProductSetSelectorImpl(projectKey, productIds, productTypeIds, staged, includeVariants,
234            productSetLimit);
235    }
236
237    /**
238     * factory method for an instance of ProductSetSelectorBuilder
239     * @return builder
240     */
241    public static ProductSetSelectorBuilder of() {
242        return new ProductSetSelectorBuilder();
243    }
244
245    /**
246     * create builder for ProductSetSelector instance
247     * @param template instance with prefilled values for the builder
248     * @return builder
249     */
250    public static ProductSetSelectorBuilder of(final ProductSetSelector template) {
251        ProductSetSelectorBuilder builder = new ProductSetSelectorBuilder();
252        builder.projectKey = template.getProjectKey();
253        builder.productIds = template.getProductIds();
254        builder.productTypeIds = template.getProductTypeIds();
255        builder.staged = template.getStaged();
256        builder.includeVariants = template.getIncludeVariants();
257        builder.productSetLimit = template.getProductSetLimit();
258        return builder;
259    }
260
261}