001 002package com.commercetools.ml.models.category_recommendations; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.validation.Valid; 009import javax.validation.constraints.NotNull; 010 011import com.commercetools.ml.models.common.CategoryReference; 012import com.fasterxml.jackson.annotation.*; 013import com.fasterxml.jackson.databind.annotation.*; 014 015import io.vrap.rmf.base.client.utils.Generated; 016 017/** 018 * ProjectCategoryRecommendation 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * ProjectCategoryRecommendation projectCategoryRecommendation = ProjectCategoryRecommendation.builder() 025 * .category(categoryBuilder -> categoryBuilder) 026 * .confidence(0.3) 027 * .path("{path}") 028 * .build() 029 * </code></pre> 030 * </div> 031 */ 032@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 033@JsonDeserialize(as = ProjectCategoryRecommendationImpl.class) 034public interface ProjectCategoryRecommendation { 035 036 /** 037 * <p>A category that is recommended for a product.</p> 038 */ 039 @NotNull 040 @Valid 041 @JsonProperty("category") 042 public CategoryReference getCategory(); 043 044 /** 045 * <p>Probability score for the category recommendation.</p> 046 */ 047 @NotNull 048 @JsonProperty("confidence") 049 public Double getConfidence(); 050 051 /** 052 * <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> 053 */ 054 @NotNull 055 @JsonProperty("path") 056 public String getPath(); 057 058 public void setCategory(final CategoryReference category); 059 060 public void setConfidence(final Double confidence); 061 062 public void setPath(final String path); 063 064 public static ProjectCategoryRecommendation of() { 065 return new ProjectCategoryRecommendationImpl(); 066 } 067 068 public static ProjectCategoryRecommendation of(final ProjectCategoryRecommendation template) { 069 ProjectCategoryRecommendationImpl instance = new ProjectCategoryRecommendationImpl(); 070 instance.setCategory(template.getCategory()); 071 instance.setConfidence(template.getConfidence()); 072 instance.setPath(template.getPath()); 073 return instance; 074 } 075 076 public static ProjectCategoryRecommendationBuilder builder() { 077 return ProjectCategoryRecommendationBuilder.of(); 078 } 079 080 public static ProjectCategoryRecommendationBuilder builder(final ProjectCategoryRecommendation template) { 081 return ProjectCategoryRecommendationBuilder.of(template); 082 } 083 084 default <T> T withProjectCategoryRecommendation(Function<ProjectCategoryRecommendation, T> helper) { 085 return helper.apply(this); 086 } 087 088 public static com.fasterxml.jackson.core.type.TypeReference<ProjectCategoryRecommendation> typeReference() { 089 return new com.fasterxml.jackson.core.type.TypeReference<ProjectCategoryRecommendation>() { 090 @Override 091 public String toString() { 092 return "TypeReference<ProjectCategoryRecommendation>"; 093 } 094 }; 095 } 096}