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    @JsonCreator
032    SimilarProductMetaImpl(@JsonProperty("name") final com.commercetools.ml.models.common.LocalizedString name,
033            @JsonProperty("description") final com.commercetools.ml.models.common.LocalizedString description,
034            @JsonProperty("price") final com.commercetools.ml.models.common.Money price,
035            @JsonProperty("variantCount") final Long variantCount) {
036        this.name = name;
037        this.description = description;
038        this.price = price;
039        this.variantCount = variantCount;
040    }
041
042    public SimilarProductMetaImpl() {
043    }
044
045    /**
046     *  <p>Localized product name used for similarity estimation.</p>
047     */
048
049    public com.commercetools.ml.models.common.LocalizedString getName() {
050        return this.name;
051    }
052
053    /**
054     *  <p>Localized product description used for similarity estimation.</p>
055     */
056
057    public com.commercetools.ml.models.common.LocalizedString getDescription() {
058        return this.description;
059    }
060
061    /**
062     *  <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>
063     */
064
065    public com.commercetools.ml.models.common.Money getPrice() {
066        return this.price;
067    }
068
069    /**
070     *  <p>Total number of variants associated with the product.</p>
071     */
072
073    public Long getVariantCount() {
074        return this.variantCount;
075    }
076
077    public void setName(final com.commercetools.ml.models.common.LocalizedString name) {
078        this.name = name;
079    }
080
081    public void setDescription(final com.commercetools.ml.models.common.LocalizedString description) {
082        this.description = description;
083    }
084
085    public void setPrice(final com.commercetools.ml.models.common.Money price) {
086        this.price = price;
087    }
088
089    public void setVariantCount(final Long variantCount) {
090        this.variantCount = variantCount;
091    }
092
093    @Override
094    public boolean equals(Object o) {
095        if (this == o)
096            return true;
097
098        if (o == null || getClass() != o.getClass())
099            return false;
100
101        SimilarProductMetaImpl that = (SimilarProductMetaImpl) o;
102
103        return new EqualsBuilder().append(name, that.name)
104                .append(description, that.description)
105                .append(price, that.price)
106                .append(variantCount, that.variantCount)
107                .isEquals();
108    }
109
110    @Override
111    public int hashCode() {
112        return new HashCodeBuilder(17, 37).append(name)
113                .append(description)
114                .append(price)
115                .append(variantCount)
116                .toHashCode();
117    }
118
119}