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>One part of a SimilarProductPair. Refers to a specific ProductVariant.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class SimilarProductImpl implements SimilarProduct, ModelBase { 022 023 private com.commercetools.ml.models.common.ProductReference product; 024 025 private Long variantId; 026 027 private com.commercetools.ml.models.similar_products.SimilarProductMeta meta; 028 029 @JsonCreator 030 SimilarProductImpl(@JsonProperty("product") final com.commercetools.ml.models.common.ProductReference product, 031 @JsonProperty("variantId") final Long variantId, 032 @JsonProperty("meta") final com.commercetools.ml.models.similar_products.SimilarProductMeta meta) { 033 this.product = product; 034 this.variantId = variantId; 035 this.meta = meta; 036 } 037 038 public SimilarProductImpl() { 039 } 040 041 /** 042 * <p>Reference to Product</p> 043 */ 044 045 public com.commercetools.ml.models.common.ProductReference getProduct() { 046 return this.product; 047 } 048 049 /** 050 * <p>ID of the ProductVariant that was compared.</p> 051 */ 052 053 public Long getVariantId() { 054 return this.variantId; 055 } 056 057 /** 058 * <p>Supplementary information about the data used for similarity estimation. This information helps you understand the estimated confidence score, but it should not be used to identify a product.</p> 059 */ 060 061 public com.commercetools.ml.models.similar_products.SimilarProductMeta getMeta() { 062 return this.meta; 063 } 064 065 public void setProduct(final com.commercetools.ml.models.common.ProductReference product) { 066 this.product = product; 067 } 068 069 public void setVariantId(final Long variantId) { 070 this.variantId = variantId; 071 } 072 073 public void setMeta(final com.commercetools.ml.models.similar_products.SimilarProductMeta meta) { 074 this.meta = meta; 075 } 076 077 @Override 078 public boolean equals(Object o) { 079 if (this == o) 080 return true; 081 082 if (o == null || getClass() != o.getClass()) 083 return false; 084 085 SimilarProductImpl that = (SimilarProductImpl) o; 086 087 return new EqualsBuilder().append(product, that.product) 088 .append(variantId, that.variantId) 089 .append(meta, that.meta) 090 .isEquals(); 091 } 092 093 @Override 094 public int hashCode() { 095 return new HashCodeBuilder(17, 37).append(product).append(variantId).append(meta).toHashCode(); 096 } 097 098}