001 002package com.commercetools.ml.models.similar_products; 003 004import java.util.*; 005 006import javax.annotation.Nullable; 007 008import io.vrap.rmf.base.client.Builder; 009import io.vrap.rmf.base.client.utils.Generated; 010 011/** 012 * SimilarityMeasuresBuilder 013 * <hr> 014 * Example to create an instance using the builder pattern 015 * <div class=code-example> 016 * <pre><code class='java'> 017 * SimilarityMeasures similarityMeasures = SimilarityMeasures.builder() 018 * .build() 019 * </code></pre> 020 * </div> 021 */ 022@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 023public class SimilarityMeasuresBuilder implements Builder<SimilarityMeasures> { 024 025 @Nullable 026 private Long name; 027 028 @Nullable 029 private Long description; 030 031 @Nullable 032 private Long attribute; 033 034 @Nullable 035 private Long variantCount; 036 037 @Nullable 038 private Long price; 039 040 /** 041 * <p>Importance of the <code>name</code> attribute in overall similarity.</p> 042 */ 043 044 public SimilarityMeasuresBuilder name(@Nullable final Long name) { 045 this.name = name; 046 return this; 047 } 048 049 /** 050 * <p>Importance of the <code>description</code> attribute in overall similarity.</p> 051 */ 052 053 public SimilarityMeasuresBuilder description(@Nullable final Long description) { 054 this.description = description; 055 return this; 056 } 057 058 /** 059 * <p>Importance of the <code>description</code> attribute in overall similarity.</p> 060 */ 061 062 public SimilarityMeasuresBuilder attribute(@Nullable final Long attribute) { 063 this.attribute = attribute; 064 return this; 065 } 066 067 /** 068 * <p>Importance of the number of product variants in overall similarity.</p> 069 */ 070 071 public SimilarityMeasuresBuilder variantCount(@Nullable final Long variantCount) { 072 this.variantCount = variantCount; 073 return this; 074 } 075 076 /** 077 * <p>Importance of the <code>price</code> attribute in overall similarity.</p> 078 */ 079 080 public SimilarityMeasuresBuilder price(@Nullable final Long price) { 081 this.price = price; 082 return this; 083 } 084 085 @Nullable 086 public Long getName() { 087 return this.name; 088 } 089 090 @Nullable 091 public Long getDescription() { 092 return this.description; 093 } 094 095 @Nullable 096 public Long getAttribute() { 097 return this.attribute; 098 } 099 100 @Nullable 101 public Long getVariantCount() { 102 return this.variantCount; 103 } 104 105 @Nullable 106 public Long getPrice() { 107 return this.price; 108 } 109 110 public SimilarityMeasures build() { 111 return new SimilarityMeasuresImpl(name, description, attribute, variantCount, price); 112 } 113 114 /** 115 * builds SimilarityMeasures without checking for non null required values 116 */ 117 public SimilarityMeasures buildUnchecked() { 118 return new SimilarityMeasuresImpl(name, description, attribute, variantCount, price); 119 } 120 121 public static SimilarityMeasuresBuilder of() { 122 return new SimilarityMeasuresBuilder(); 123 } 124 125 public static SimilarityMeasuresBuilder of(final SimilarityMeasures template) { 126 SimilarityMeasuresBuilder builder = new SimilarityMeasuresBuilder(); 127 builder.name = template.getName(); 128 builder.description = template.getDescription(); 129 builder.attribute = template.getAttribute(); 130 builder.variantCount = template.getVariantCount(); 131 builder.price = template.getPrice(); 132 return builder; 133 } 134 135}