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 /** 036 * create instance with all properties 037 */ 038 @JsonCreator 039 ProductSetSelectorImpl(@JsonProperty("projectKey") final String projectKey, 040 @JsonProperty("productIds") final java.util.List<String> productIds, 041 @JsonProperty("productTypeIds") final java.util.List<String> productTypeIds, 042 @JsonProperty("staged") final Boolean staged, 043 @JsonProperty("includeVariants") final Boolean includeVariants, 044 @JsonProperty("productSetLimit") final Long productSetLimit) { 045 this.projectKey = projectKey; 046 this.productIds = productIds; 047 this.productTypeIds = productTypeIds; 048 this.staged = staged; 049 this.includeVariants = includeVariants; 050 this.productSetLimit = productSetLimit; 051 } 052 053 /** 054 * create empty instance 055 */ 056 public ProductSetSelectorImpl() { 057 } 058 059 /** 060 * <p>The project containing the project set.</p> 061 */ 062 063 public String getProjectKey() { 064 return this.projectKey; 065 } 066 067 /** 068 * <p>An array of Product IDs to compare. If unspecified, no Product ID filter is applied.</p> 069 */ 070 071 public java.util.List<String> getProductIds() { 072 return this.productIds; 073 } 074 075 /** 076 * <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> 077 */ 078 079 public java.util.List<String> getProductTypeIds() { 080 return this.productTypeIds; 081 } 082 083 /** 084 * <p>Specifies use of staged or current product data.</p> 085 */ 086 087 public Boolean getStaged() { 088 return this.staged; 089 } 090 091 /** 092 * <p>Specifies use of product variants. If set to <code>true</code>, all product variants are compared, not just the master variant.</p> 093 */ 094 095 public Boolean getIncludeVariants() { 096 return this.includeVariants; 097 } 098 099 /** 100 * <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> 101 */ 102 103 public Long getProductSetLimit() { 104 return this.productSetLimit; 105 } 106 107 public void setProjectKey(final String projectKey) { 108 this.projectKey = projectKey; 109 } 110 111 public void setProductIds(final String... productIds) { 112 this.productIds = new ArrayList<>(Arrays.asList(productIds)); 113 } 114 115 public void setProductIds(final java.util.List<String> productIds) { 116 this.productIds = productIds; 117 } 118 119 public void setProductTypeIds(final String... productTypeIds) { 120 this.productTypeIds = new ArrayList<>(Arrays.asList(productTypeIds)); 121 } 122 123 public void setProductTypeIds(final java.util.List<String> productTypeIds) { 124 this.productTypeIds = productTypeIds; 125 } 126 127 public void setStaged(final Boolean staged) { 128 this.staged = staged; 129 } 130 131 public void setIncludeVariants(final Boolean includeVariants) { 132 this.includeVariants = includeVariants; 133 } 134 135 public void setProductSetLimit(final Long productSetLimit) { 136 this.productSetLimit = productSetLimit; 137 } 138 139 @Override 140 public boolean equals(Object o) { 141 if (this == o) 142 return true; 143 144 if (o == null || getClass() != o.getClass()) 145 return false; 146 147 ProductSetSelectorImpl that = (ProductSetSelectorImpl) o; 148 149 return new EqualsBuilder().append(projectKey, that.projectKey) 150 .append(productIds, that.productIds) 151 .append(productTypeIds, that.productTypeIds) 152 .append(staged, that.staged) 153 .append(includeVariants, that.includeVariants) 154 .append(productSetLimit, that.productSetLimit) 155 .isEquals(); 156 } 157 158 @Override 159 public int hashCode() { 160 return new HashCodeBuilder(17, 37).append(projectKey) 161 .append(productIds) 162 .append(productTypeIds) 163 .append(staged) 164 .append(includeVariants) 165 .append(productSetLimit) 166 .toHashCode(); 167 } 168 169}