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    /**
030     * create instance with all properties
031     */
032    @JsonCreator
033    SimilarProductImpl(@JsonProperty("product") final com.commercetools.ml.models.common.ProductReference product,
034            @JsonProperty("variantId") final Long variantId,
035            @JsonProperty("meta") final com.commercetools.ml.models.similar_products.SimilarProductMeta meta) {
036        this.product = product;
037        this.variantId = variantId;
038        this.meta = meta;
039    }
040
041    /**
042     * create empty instance
043     */
044    public SimilarProductImpl() {
045    }
046
047    /**
048     *  <p>Reference to Product</p>
049     */
050
051    public com.commercetools.ml.models.common.ProductReference getProduct() {
052        return this.product;
053    }
054
055    /**
056     *  <p>ID of the ProductVariant that was compared.</p>
057     */
058
059    public Long getVariantId() {
060        return this.variantId;
061    }
062
063    /**
064     *  <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>
065     */
066
067    public com.commercetools.ml.models.similar_products.SimilarProductMeta getMeta() {
068        return this.meta;
069    }
070
071    public void setProduct(final com.commercetools.ml.models.common.ProductReference product) {
072        this.product = product;
073    }
074
075    public void setVariantId(final Long variantId) {
076        this.variantId = variantId;
077    }
078
079    public void setMeta(final com.commercetools.ml.models.similar_products.SimilarProductMeta meta) {
080        this.meta = meta;
081    }
082
083    @Override
084    public boolean equals(Object o) {
085        if (this == o)
086            return true;
087
088        if (o == null || getClass() != o.getClass())
089            return false;
090
091        SimilarProductImpl that = (SimilarProductImpl) o;
092
093        return new EqualsBuilder().append(product, that.product)
094                .append(variantId, that.variantId)
095                .append(meta, that.meta)
096                .append(product, that.product)
097                .append(variantId, that.variantId)
098                .append(meta, that.meta)
099                .isEquals();
100    }
101
102    @Override
103    public int hashCode() {
104        return new HashCodeBuilder(17, 37).append(product).append(variantId).append(meta).toHashCode();
105    }
106
107}