001
002package com.commercetools.ml.models.category_recommendations;
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 * ProjectCategoryRecommendation
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProjectCategoryRecommendationImpl implements ProjectCategoryRecommendation, ModelBase {
022
023    private com.commercetools.ml.models.common.CategoryReference category;
024
025    private Double confidence;
026
027    private String path;
028
029    /**
030     * create instance with all properties
031     */
032    @JsonCreator
033    ProjectCategoryRecommendationImpl(
034            @JsonProperty("category") final com.commercetools.ml.models.common.CategoryReference category,
035            @JsonProperty("confidence") final Double confidence, @JsonProperty("path") final String path) {
036        this.category = category;
037        this.confidence = confidence;
038        this.path = path;
039    }
040
041    /**
042     * create empty instance
043     */
044    public ProjectCategoryRecommendationImpl() {
045    }
046
047    /**
048     *  <p>A category that is recommended for a product.</p>
049     */
050
051    public com.commercetools.ml.models.common.CategoryReference getCategory() {
052        return this.category;
053    }
054
055    /**
056     *  <p>Probability score for the category recommendation.</p>
057     */
058
059    public Double getConfidence() {
060        return this.confidence;
061    }
062
063    /**
064     *  <p>Breadcrumb path to the recommended category. This only picks up one language, not all available languages for the category. English is prioritized, but if English data is not available, an arbitrary language is selected. Do not use this to identify a category,use the category ID from the category reference instead.</p>
065     */
066
067    public String getPath() {
068        return this.path;
069    }
070
071    public void setCategory(final com.commercetools.ml.models.common.CategoryReference category) {
072        this.category = category;
073    }
074
075    public void setConfidence(final Double confidence) {
076        this.confidence = confidence;
077    }
078
079    public void setPath(final String path) {
080        this.path = path;
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        ProjectCategoryRecommendationImpl that = (ProjectCategoryRecommendationImpl) o;
092
093        return new EqualsBuilder().append(category, that.category)
094                .append(confidence, that.confidence)
095                .append(path, that.path)
096                .isEquals();
097    }
098
099    @Override
100    public int hashCode() {
101        return new HashCodeBuilder(17, 37).append(category).append(confidence).append(path).toHashCode();
102    }
103
104}