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 * SimilarProductSearchRequest 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class SimilarProductSearchRequestImpl implements SimilarProductSearchRequest, ModelBase { 022 023 private Long limit; 024 025 private Long offset; 026 027 private String language; 028 029 private String currencyCode; 030 031 private com.commercetools.ml.models.similar_products.SimilarityMeasures similarityMeasures; 032 033 private java.util.List<com.commercetools.ml.models.similar_products.ProductSetSelector> productSetSelectors; 034 035 private Double confidenceMin; 036 037 private Double confidenceMax; 038 039 /** 040 * create instance with all properties 041 */ 042 @JsonCreator 043 SimilarProductSearchRequestImpl(@JsonProperty("limit") final Long limit, @JsonProperty("offset") final Long offset, 044 @JsonProperty("language") final String language, @JsonProperty("currencyCode") final String currencyCode, 045 @JsonProperty("similarityMeasures") final com.commercetools.ml.models.similar_products.SimilarityMeasures similarityMeasures, 046 @JsonProperty("productSetSelectors") final java.util.List<com.commercetools.ml.models.similar_products.ProductSetSelector> productSetSelectors, 047 @JsonProperty("confidenceMin") final Double confidenceMin, 048 @JsonProperty("confidenceMax") final Double confidenceMax) { 049 this.limit = limit; 050 this.offset = offset; 051 this.language = language; 052 this.currencyCode = currencyCode; 053 this.similarityMeasures = similarityMeasures; 054 this.productSetSelectors = productSetSelectors; 055 this.confidenceMin = confidenceMin; 056 this.confidenceMax = confidenceMax; 057 } 058 059 /** 060 * create empty instance 061 */ 062 public SimilarProductSearchRequestImpl() { 063 } 064 065 /** 066 * <p>Number of results requested.</p> 067 */ 068 069 public Long getLimit() { 070 return this.limit; 071 } 072 073 /** 074 * <p>Number of elements skipped.</p> 075 */ 076 077 public Long getOffset() { 078 return this.offset; 079 } 080 081 /** 082 * <p>language tag used to prioritize language for text comparisons.</p> 083 */ 084 085 public String getLanguage() { 086 return this.language; 087 } 088 089 /** 090 * <p>The three-digit currency code to compare prices in. When a product has multiple prices, all prices for the product are converted to the currency provided by the currency attribute and the median price is calculated for comparison. Currencies are converted using the ECB currency exchange rates at the time the request is made. Of the currency codes, only currencies with currency exchange rates provided by the ECB are supported.</p> 091 */ 092 093 public String getCurrencyCode() { 094 return this.currencyCode; 095 } 096 097 /** 098 * <p><code>similarityMeasures</code> defines the attributes taken into account to measure product similarity.</p> 099 */ 100 101 public com.commercetools.ml.models.similar_products.SimilarityMeasures getSimilarityMeasures() { 102 return this.similarityMeasures; 103 } 104 105 /** 106 * <p>Array of length 2 of ProductSetSelector</p> 107 */ 108 109 public java.util.List<com.commercetools.ml.models.similar_products.ProductSetSelector> getProductSetSelectors() { 110 return this.productSetSelectors; 111 } 112 113 /** 114 * 115 */ 116 117 public Double getConfidenceMin() { 118 return this.confidenceMin; 119 } 120 121 /** 122 * 123 */ 124 125 public Double getConfidenceMax() { 126 return this.confidenceMax; 127 } 128 129 public void setLimit(final Long limit) { 130 this.limit = limit; 131 } 132 133 public void setOffset(final Long offset) { 134 this.offset = offset; 135 } 136 137 public void setLanguage(final String language) { 138 this.language = language; 139 } 140 141 public void setCurrencyCode(final String currencyCode) { 142 this.currencyCode = currencyCode; 143 } 144 145 public void setSimilarityMeasures( 146 final com.commercetools.ml.models.similar_products.SimilarityMeasures similarityMeasures) { 147 this.similarityMeasures = similarityMeasures; 148 } 149 150 public void setProductSetSelectors( 151 final com.commercetools.ml.models.similar_products.ProductSetSelector... productSetSelectors) { 152 this.productSetSelectors = new ArrayList<>(Arrays.asList(productSetSelectors)); 153 } 154 155 public void setProductSetSelectors( 156 final java.util.List<com.commercetools.ml.models.similar_products.ProductSetSelector> productSetSelectors) { 157 this.productSetSelectors = productSetSelectors; 158 } 159 160 public void setConfidenceMin(final Double confidenceMin) { 161 this.confidenceMin = confidenceMin; 162 } 163 164 public void setConfidenceMax(final Double confidenceMax) { 165 this.confidenceMax = confidenceMax; 166 } 167 168 @Override 169 public boolean equals(Object o) { 170 if (this == o) 171 return true; 172 173 if (o == null || getClass() != o.getClass()) 174 return false; 175 176 SimilarProductSearchRequestImpl that = (SimilarProductSearchRequestImpl) o; 177 178 return new EqualsBuilder().append(limit, that.limit) 179 .append(offset, that.offset) 180 .append(language, that.language) 181 .append(currencyCode, that.currencyCode) 182 .append(similarityMeasures, that.similarityMeasures) 183 .append(productSetSelectors, that.productSetSelectors) 184 .append(confidenceMin, that.confidenceMin) 185 .append(confidenceMax, that.confidenceMax) 186 .append(limit, that.limit) 187 .append(offset, that.offset) 188 .append(language, that.language) 189 .append(currencyCode, that.currencyCode) 190 .append(similarityMeasures, that.similarityMeasures) 191 .append(productSetSelectors, that.productSetSelectors) 192 .append(confidenceMin, that.confidenceMin) 193 .append(confidenceMax, that.confidenceMax) 194 .isEquals(); 195 } 196 197 @Override 198 public int hashCode() { 199 return new HashCodeBuilder(17, 37).append(limit) 200 .append(offset) 201 .append(language) 202 .append(currencyCode) 203 .append(similarityMeasures) 204 .append(productSetSelectors) 205 .append(confidenceMin) 206 .append(confidenceMax) 207 .toHashCode(); 208 } 209 210}