001 002package com.commercetools.ml.models.category_recommendations; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.constraints.NotNull; 010 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * ProjectCategoryRecommendationMeta 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * ProjectCategoryRecommendationMeta projectCategoryRecommendationMeta = ProjectCategoryRecommendationMeta.builder() 024 * .plusGeneralCategoryNames(generalCategoryNamesBuilder -> generalCategoryNamesBuilder) 025 * .build() 026 * </code></pre> 027 * </div> 028 */ 029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 030@JsonDeserialize(as = ProjectCategoryRecommendationMetaImpl.class) 031public interface ProjectCategoryRecommendationMeta { 032 033 /** 034 * <p>The product name that was used to generate recommendations.</p> 035 * @return productName 036 */ 037 038 @JsonProperty("productName") 039 public String getProductName(); 040 041 /** 042 * <p>The product image that was used to generate recommendations.</p> 043 * @return productImageUrl 044 */ 045 046 @JsonProperty("productImageUrl") 047 public String getProductImageUrl(); 048 049 /** 050 * <p>Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.</p> 051 * @return generalCategoryNames 052 */ 053 @NotNull 054 @JsonProperty("generalCategoryNames") 055 public List<String> getGeneralCategoryNames(); 056 057 /** 058 * <p>The product name that was used to generate recommendations.</p> 059 * @param productName value to be set 060 */ 061 062 public void setProductName(final String productName); 063 064 /** 065 * <p>The product image that was used to generate recommendations.</p> 066 * @param productImageUrl value to be set 067 */ 068 069 public void setProductImageUrl(final String productImageUrl); 070 071 /** 072 * <p>Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.</p> 073 * @param generalCategoryNames values to be set 074 */ 075 076 @JsonIgnore 077 public void setGeneralCategoryNames(final String... generalCategoryNames); 078 079 /** 080 * <p>Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.</p> 081 * @param generalCategoryNames values to be set 082 */ 083 084 public void setGeneralCategoryNames(final List<String> generalCategoryNames); 085 086 /** 087 * factory method 088 * @return instance of ProjectCategoryRecommendationMeta 089 */ 090 public static ProjectCategoryRecommendationMeta of() { 091 return new ProjectCategoryRecommendationMetaImpl(); 092 } 093 094 /** 095 * factory method to create a shallow copy ProjectCategoryRecommendationMeta 096 * @param template instance to be copied 097 * @return copy instance 098 */ 099 public static ProjectCategoryRecommendationMeta of(final ProjectCategoryRecommendationMeta template) { 100 ProjectCategoryRecommendationMetaImpl instance = new ProjectCategoryRecommendationMetaImpl(); 101 instance.setProductName(template.getProductName()); 102 instance.setProductImageUrl(template.getProductImageUrl()); 103 instance.setGeneralCategoryNames(template.getGeneralCategoryNames()); 104 return instance; 105 } 106 107 /** 108 * factory method to create a deep copy of ProjectCategoryRecommendationMeta 109 * @param template instance to be copied 110 * @return copy instance 111 */ 112 @Nullable 113 public static ProjectCategoryRecommendationMeta deepCopy( 114 @Nullable final ProjectCategoryRecommendationMeta template) { 115 if (template == null) { 116 return null; 117 } 118 ProjectCategoryRecommendationMetaImpl instance = new ProjectCategoryRecommendationMetaImpl(); 119 instance.setProductName(template.getProductName()); 120 instance.setProductImageUrl(template.getProductImageUrl()); 121 instance.setGeneralCategoryNames( 122 Optional.ofNullable(template.getGeneralCategoryNames()).map(ArrayList::new).orElse(null)); 123 return instance; 124 } 125 126 /** 127 * builder factory method for ProjectCategoryRecommendationMeta 128 * @return builder 129 */ 130 public static ProjectCategoryRecommendationMetaBuilder builder() { 131 return ProjectCategoryRecommendationMetaBuilder.of(); 132 } 133 134 /** 135 * create builder for ProjectCategoryRecommendationMeta instance 136 * @param template instance with prefilled values for the builder 137 * @return builder 138 */ 139 public static ProjectCategoryRecommendationMetaBuilder builder(final ProjectCategoryRecommendationMeta template) { 140 return ProjectCategoryRecommendationMetaBuilder.of(template); 141 } 142 143 /** 144 * accessor map function 145 * @param <T> mapped type 146 * @param helper function to map the object 147 * @return mapped value 148 */ 149 default <T> T withProjectCategoryRecommendationMeta(Function<ProjectCategoryRecommendationMeta, T> helper) { 150 return helper.apply(this); 151 } 152 153 /** 154 * gives a TypeReference for usage with Jackson DataBind 155 * @return TypeReference 156 */ 157 public static com.fasterxml.jackson.core.type.TypeReference<ProjectCategoryRecommendationMeta> typeReference() { 158 return new com.fasterxml.jackson.core.type.TypeReference<ProjectCategoryRecommendationMeta>() { 159 @Override 160 public String toString() { 161 return "TypeReference<ProjectCategoryRecommendationMeta>"; 162 } 163 }; 164 } 165}