001 002package com.commercetools.ml.models.similar_products; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.constraints.NotNull; 010 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * <p>A set of ProductData for comparison. If no optional attributes are specified, all <code>current</code> ProductData are selected for comparison.</p> 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * ProductSetSelector productSetSelector = ProductSetSelector.builder() 024 * .projectKey("{projectKey}") 025 * .build() 026 * </code></pre> 027 * </div> 028 */ 029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 030@JsonDeserialize(as = ProductSetSelectorImpl.class) 031public interface ProductSetSelector { 032 033 /** 034 * <p>The project containing the project set.</p> 035 * @return projectKey 036 */ 037 @NotNull 038 @JsonProperty("projectKey") 039 public String getProjectKey(); 040 041 /** 042 * <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p> 043 * @return productIds 044 */ 045 046 @JsonProperty("productIds") 047 public List<String> getProductIds(); 048 049 /** 050 * <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> 051 * @return productTypeIds 052 */ 053 054 @JsonProperty("productTypeIds") 055 public List<String> getProductTypeIds(); 056 057 /** 058 * <p>Specifies use of staged or current product data.</p> 059 * @return staged 060 */ 061 062 @JsonProperty("staged") 063 public Boolean getStaged(); 064 065 /** 066 * <p>Specifies use of product variants. If set to <code>true</code>, all product variants are compared, not just the master variant.</p> 067 * @return includeVariants 068 */ 069 070 @JsonProperty("includeVariants") 071 public Boolean getIncludeVariants(); 072 073 /** 074 * <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> 075 * @return productSetLimit 076 */ 077 078 @JsonProperty("productSetLimit") 079 public Long getProductSetLimit(); 080 081 /** 082 * <p>The project containing the project set.</p> 083 * @param projectKey value to be set 084 */ 085 086 public void setProjectKey(final String projectKey); 087 088 /** 089 * <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p> 090 * @param productIds values to be set 091 */ 092 093 @JsonIgnore 094 public void setProductIds(final String... productIds); 095 096 /** 097 * <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p> 098 * @param productIds values to be set 099 */ 100 101 public void setProductIds(final List<String> productIds); 102 103 /** 104 * <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> 105 * @param productTypeIds values to be set 106 */ 107 108 @JsonIgnore 109 public void setProductTypeIds(final String... productTypeIds); 110 111 /** 112 * <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> 113 * @param productTypeIds values to be set 114 */ 115 116 public void setProductTypeIds(final List<String> productTypeIds); 117 118 /** 119 * <p>Specifies use of staged or current product data.</p> 120 * @param staged value to be set 121 */ 122 123 public void setStaged(final Boolean staged); 124 125 /** 126 * <p>Specifies use of product variants. If set to <code>true</code>, all product variants are compared, not just the master variant.</p> 127 * @param includeVariants value to be set 128 */ 129 130 public void setIncludeVariants(final Boolean includeVariants); 131 132 /** 133 * <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> 134 * @param productSetLimit value to be set 135 */ 136 137 public void setProductSetLimit(final Long productSetLimit); 138 139 /** 140 * factory method 141 * @return instance of ProductSetSelector 142 */ 143 public static ProductSetSelector of() { 144 return new ProductSetSelectorImpl(); 145 } 146 147 /** 148 * factory method to create a shallow copy ProductSetSelector 149 * @param template instance to be copied 150 * @return copy instance 151 */ 152 public static ProductSetSelector of(final ProductSetSelector template) { 153 ProductSetSelectorImpl instance = new ProductSetSelectorImpl(); 154 instance.setProjectKey(template.getProjectKey()); 155 instance.setProductIds(template.getProductIds()); 156 instance.setProductTypeIds(template.getProductTypeIds()); 157 instance.setStaged(template.getStaged()); 158 instance.setIncludeVariants(template.getIncludeVariants()); 159 instance.setProductSetLimit(template.getProductSetLimit()); 160 return instance; 161 } 162 163 /** 164 * factory method to create a deep copy of ProductSetSelector 165 * @param template instance to be copied 166 * @return copy instance 167 */ 168 @Nullable 169 public static ProductSetSelector deepCopy(@Nullable final ProductSetSelector template) { 170 if (template == null) { 171 return null; 172 } 173 ProductSetSelectorImpl instance = new ProductSetSelectorImpl(); 174 instance.setProjectKey(template.getProjectKey()); 175 instance.setProductIds(Optional.ofNullable(template.getProductIds()).map(ArrayList::new).orElse(null)); 176 instance.setProductTypeIds(Optional.ofNullable(template.getProductTypeIds()).map(ArrayList::new).orElse(null)); 177 instance.setStaged(template.getStaged()); 178 instance.setIncludeVariants(template.getIncludeVariants()); 179 instance.setProductSetLimit(template.getProductSetLimit()); 180 return instance; 181 } 182 183 /** 184 * builder factory method for ProductSetSelector 185 * @return builder 186 */ 187 public static ProductSetSelectorBuilder builder() { 188 return ProductSetSelectorBuilder.of(); 189 } 190 191 /** 192 * create builder for ProductSetSelector instance 193 * @param template instance with prefilled values for the builder 194 * @return builder 195 */ 196 public static ProductSetSelectorBuilder builder(final ProductSetSelector template) { 197 return ProductSetSelectorBuilder.of(template); 198 } 199 200 /** 201 * accessor map function 202 * @param <T> mapped type 203 * @param helper function to map the object 204 * @return mapped value 205 */ 206 default <T> T withProductSetSelector(Function<ProductSetSelector, T> helper) { 207 return helper.apply(this); 208 } 209 210 /** 211 * gives a TypeReference for usage with Jackson DataBind 212 * @return TypeReference 213 */ 214 public static com.fasterxml.jackson.core.type.TypeReference<ProductSetSelector> typeReference() { 215 return new com.fasterxml.jackson.core.type.TypeReference<ProductSetSelector>() { 216 @Override 217 public String toString() { 218 return "TypeReference<ProductSetSelector>"; 219 } 220 }; 221 } 222}