001 002package com.commercetools.ml.models.similar_products; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009 010import com.fasterxml.jackson.annotation.*; 011import com.fasterxml.jackson.databind.annotation.*; 012 013import io.vrap.rmf.base.client.utils.Generated; 014 015/** 016 * <p>Specify which ProductData attributes to use for estimating similarity and how to weigh them. An attribute's weight can be any whole positive integer, starting with 0. The larger the integer, the higher its weight.</p> 017 * 018 * <hr> 019 * Example to create an instance using the builder pattern 020 * <div class=code-example> 021 * <pre><code class='java'> 022 * SimilarityMeasures similarityMeasures = SimilarityMeasures.builder() 023 * .build() 024 * </code></pre> 025 * </div> 026 */ 027@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 028@JsonDeserialize(as = SimilarityMeasuresImpl.class) 029public interface SimilarityMeasures { 030 031 /** 032 * <p>Importance of the <code>name</code> attribute in overall similarity.</p> 033 * @return name 034 */ 035 036 @JsonProperty("name") 037 public Long getName(); 038 039 /** 040 * <p>Importance of the <code>description</code> attribute in overall similarity.</p> 041 * @return description 042 */ 043 044 @JsonProperty("description") 045 public Long getDescription(); 046 047 /** 048 * <p>Importance of the <code>description</code> attribute in overall similarity.</p> 049 * @return attribute 050 */ 051 052 @JsonProperty("attribute") 053 public Long getAttribute(); 054 055 /** 056 * <p>Importance of the number of product variants in overall similarity.</p> 057 * @return variantCount 058 */ 059 060 @JsonProperty("variantCount") 061 public Long getVariantCount(); 062 063 /** 064 * <p>Importance of the <code>price</code> attribute in overall similarity.</p> 065 * @return price 066 */ 067 068 @JsonProperty("price") 069 public Long getPrice(); 070 071 /** 072 * <p>Importance of the <code>name</code> attribute in overall similarity.</p> 073 * @param name value to be set 074 */ 075 076 public void setName(final Long name); 077 078 /** 079 * <p>Importance of the <code>description</code> attribute in overall similarity.</p> 080 * @param description value to be set 081 */ 082 083 public void setDescription(final Long description); 084 085 /** 086 * <p>Importance of the <code>description</code> attribute in overall similarity.</p> 087 * @param attribute value to be set 088 */ 089 090 public void setAttribute(final Long attribute); 091 092 /** 093 * <p>Importance of the number of product variants in overall similarity.</p> 094 * @param variantCount value to be set 095 */ 096 097 public void setVariantCount(final Long variantCount); 098 099 /** 100 * <p>Importance of the <code>price</code> attribute in overall similarity.</p> 101 * @param price value to be set 102 */ 103 104 public void setPrice(final Long price); 105 106 /** 107 * factory method 108 * @return instance of SimilarityMeasures 109 */ 110 public static SimilarityMeasures of() { 111 return new SimilarityMeasuresImpl(); 112 } 113 114 /** 115 * factory method to create a shallow copy SimilarityMeasures 116 * @param template instance to be copied 117 * @return copy instance 118 */ 119 public static SimilarityMeasures of(final SimilarityMeasures template) { 120 SimilarityMeasuresImpl instance = new SimilarityMeasuresImpl(); 121 instance.setName(template.getName()); 122 instance.setDescription(template.getDescription()); 123 instance.setAttribute(template.getAttribute()); 124 instance.setVariantCount(template.getVariantCount()); 125 instance.setPrice(template.getPrice()); 126 return instance; 127 } 128 129 /** 130 * factory method to create a deep copy of SimilarityMeasures 131 * @param template instance to be copied 132 * @return copy instance 133 */ 134 @Nullable 135 public static SimilarityMeasures deepCopy(@Nullable final SimilarityMeasures template) { 136 if (template == null) { 137 return null; 138 } 139 SimilarityMeasuresImpl instance = new SimilarityMeasuresImpl(); 140 instance.setName(template.getName()); 141 instance.setDescription(template.getDescription()); 142 instance.setAttribute(template.getAttribute()); 143 instance.setVariantCount(template.getVariantCount()); 144 instance.setPrice(template.getPrice()); 145 return instance; 146 } 147 148 /** 149 * builder factory method for SimilarityMeasures 150 * @return builder 151 */ 152 public static SimilarityMeasuresBuilder builder() { 153 return SimilarityMeasuresBuilder.of(); 154 } 155 156 /** 157 * create builder for SimilarityMeasures instance 158 * @param template instance with prefilled values for the builder 159 * @return builder 160 */ 161 public static SimilarityMeasuresBuilder builder(final SimilarityMeasures template) { 162 return SimilarityMeasuresBuilder.of(template); 163 } 164 165 /** 166 * accessor map function 167 * @param <T> mapped type 168 * @param helper function to map the object 169 * @return mapped value 170 */ 171 default <T> T withSimilarityMeasures(Function<SimilarityMeasures, T> helper) { 172 return helper.apply(this); 173 } 174 175 /** 176 * gives a TypeReference for usage with Jackson DataBind 177 * @return TypeReference 178 */ 179 public static com.fasterxml.jackson.core.type.TypeReference<SimilarityMeasures> typeReference() { 180 return new com.fasterxml.jackson.core.type.TypeReference<SimilarityMeasures>() { 181 @Override 182 public String toString() { 183 return "TypeReference<SimilarityMeasures>"; 184 } 185 }; 186 } 187}