001 002package com.commercetools.api.models.order; 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 * OrderSearchAnyValueBuilder 013 * <hr> 014 * Example to create an instance using the builder pattern 015 * <div class=code-example> 016 * <pre><code class='java'> 017 * OrderSearchAnyValue orderSearchAnyValue = OrderSearchAnyValue.builder() 018 * .field("{field}") 019 * .build() 020 * </code></pre> 021 * </div> 022 */ 023@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 024public class OrderSearchAnyValueBuilder implements Builder<OrderSearchAnyValue> { 025 026 private String field; 027 028 @Nullable 029 private Integer boost; 030 031 @Nullable 032 private String customType; 033 034 private java.lang.Object value; 035 036 @Nullable 037 private String language; 038 039 @Nullable 040 private Boolean caseInsensitive; 041 042 /** 043 * set the value to the field 044 * @param field value to be set 045 * @return Builder 046 */ 047 048 public OrderSearchAnyValueBuilder field(final String field) { 049 this.field = field; 050 return this; 051 } 052 053 /** 054 * set the value to the boost 055 * @param boost value to be set 056 * @return Builder 057 */ 058 059 public OrderSearchAnyValueBuilder boost(@Nullable final Integer boost) { 060 this.boost = boost; 061 return this; 062 } 063 064 /** 065 * set the value to the customType 066 * @param customType value to be set 067 * @return Builder 068 */ 069 070 public OrderSearchAnyValueBuilder customType(@Nullable final String customType) { 071 this.customType = customType; 072 return this; 073 } 074 075 /** 076 * set the value to the value 077 * @param value value to be set 078 * @return Builder 079 */ 080 081 public OrderSearchAnyValueBuilder value(final java.lang.Object value) { 082 this.value = value; 083 return this; 084 } 085 086 /** 087 * set the value to the language 088 * @param language value to be set 089 * @return Builder 090 */ 091 092 public OrderSearchAnyValueBuilder language(@Nullable final String language) { 093 this.language = language; 094 return this; 095 } 096 097 /** 098 * set the value to the caseInsensitive 099 * @param caseInsensitive value to be set 100 * @return Builder 101 */ 102 103 public OrderSearchAnyValueBuilder caseInsensitive(@Nullable final Boolean caseInsensitive) { 104 this.caseInsensitive = caseInsensitive; 105 return this; 106 } 107 108 /** 109 * value of field} 110 * @return field 111 */ 112 113 public String getField() { 114 return this.field; 115 } 116 117 /** 118 * value of boost} 119 * @return boost 120 */ 121 122 @Nullable 123 public Integer getBoost() { 124 return this.boost; 125 } 126 127 /** 128 * value of customType} 129 * @return customType 130 */ 131 132 @Nullable 133 public String getCustomType() { 134 return this.customType; 135 } 136 137 /** 138 * value of value} 139 * @return value 140 */ 141 142 public java.lang.Object getValue() { 143 return this.value; 144 } 145 146 /** 147 * value of language} 148 * @return language 149 */ 150 151 @Nullable 152 public String getLanguage() { 153 return this.language; 154 } 155 156 /** 157 * value of caseInsensitive} 158 * @return caseInsensitive 159 */ 160 161 @Nullable 162 public Boolean getCaseInsensitive() { 163 return this.caseInsensitive; 164 } 165 166 /** 167 * builds OrderSearchAnyValue with checking for non-null required values 168 * @return OrderSearchAnyValue 169 */ 170 public OrderSearchAnyValue build() { 171 Objects.requireNonNull(field, OrderSearchAnyValue.class + ": field is missing"); 172 Objects.requireNonNull(value, OrderSearchAnyValue.class + ": value is missing"); 173 return new OrderSearchAnyValueImpl(field, boost, customType, value, language, caseInsensitive); 174 } 175 176 /** 177 * builds OrderSearchAnyValue without checking for non-null required values 178 * @return OrderSearchAnyValue 179 */ 180 public OrderSearchAnyValue buildUnchecked() { 181 return new OrderSearchAnyValueImpl(field, boost, customType, value, language, caseInsensitive); 182 } 183 184 /** 185 * factory method for an instance of OrderSearchAnyValueBuilder 186 * @return builder 187 */ 188 public static OrderSearchAnyValueBuilder of() { 189 return new OrderSearchAnyValueBuilder(); 190 } 191 192 /** 193 * create builder for OrderSearchAnyValue instance 194 * @param template instance with prefilled values for the builder 195 * @return builder 196 */ 197 public static OrderSearchAnyValueBuilder of(final OrderSearchAnyValue template) { 198 OrderSearchAnyValueBuilder builder = new OrderSearchAnyValueBuilder(); 199 builder.field = template.getField(); 200 builder.boost = template.getBoost(); 201 builder.customType = template.getCustomType(); 202 builder.value = template.getValue(); 203 builder.language = template.getLanguage(); 204 builder.caseInsensitive = template.getCaseInsensitive(); 205 return builder; 206 } 207 208}