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 * SimilarProductMeta 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class SimilarProductMetaImpl implements SimilarProductMeta, ModelBase { 022 023 private com.commercetools.ml.models.common.LocalizedString name; 024 025 private com.commercetools.ml.models.common.LocalizedString description; 026 027 private com.commercetools.ml.models.common.Money price; 028 029 private Long variantCount; 030 031 /** 032 * create instance with all properties 033 */ 034 @JsonCreator 035 SimilarProductMetaImpl(@JsonProperty("name") final com.commercetools.ml.models.common.LocalizedString name, 036 @JsonProperty("description") final com.commercetools.ml.models.common.LocalizedString description, 037 @JsonProperty("price") final com.commercetools.ml.models.common.Money price, 038 @JsonProperty("variantCount") final Long variantCount) { 039 this.name = name; 040 this.description = description; 041 this.price = price; 042 this.variantCount = variantCount; 043 } 044 045 /** 046 * create empty instance 047 */ 048 public SimilarProductMetaImpl() { 049 } 050 051 /** 052 * <p>Localized product name used for similarity estimation.</p> 053 */ 054 055 public com.commercetools.ml.models.common.LocalizedString getName() { 056 return this.name; 057 } 058 059 /** 060 * <p>Localized product description used for similarity estimation.</p> 061 */ 062 063 public com.commercetools.ml.models.common.LocalizedString getDescription() { 064 return this.description; 065 } 066 067 /** 068 * <p>The product price in cents using the currency defined in SimilarProductSearchRequest If multiple prices exist, the median value is taken as a representative amount.</p> 069 */ 070 071 public com.commercetools.ml.models.common.Money getPrice() { 072 return this.price; 073 } 074 075 /** 076 * <p>Total number of variants associated with the product.</p> 077 */ 078 079 public Long getVariantCount() { 080 return this.variantCount; 081 } 082 083 public void setName(final com.commercetools.ml.models.common.LocalizedString name) { 084 this.name = name; 085 } 086 087 public void setDescription(final com.commercetools.ml.models.common.LocalizedString description) { 088 this.description = description; 089 } 090 091 public void setPrice(final com.commercetools.ml.models.common.Money price) { 092 this.price = price; 093 } 094 095 public void setVariantCount(final Long variantCount) { 096 this.variantCount = variantCount; 097 } 098 099 @Override 100 public boolean equals(Object o) { 101 if (this == o) 102 return true; 103 104 if (o == null || getClass() != o.getClass()) 105 return false; 106 107 SimilarProductMetaImpl that = (SimilarProductMetaImpl) o; 108 109 return new EqualsBuilder().append(name, that.name) 110 .append(description, that.description) 111 .append(price, that.price) 112 .append(variantCount, that.variantCount) 113 .isEquals(); 114 } 115 116 @Override 117 public int hashCode() { 118 return new HashCodeBuilder(17, 37).append(name) 119 .append(description) 120 .append(price) 121 .append(variantCount) 122 .toHashCode(); 123 } 124 125}