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 * OrderSearchQueryExpressionValueBuilder 013 * <hr> 014 * Example to create an instance using the builder pattern 015 * <div class=code-example> 016 * <pre><code class='java'> 017 * OrderSearchQueryExpressionValue orderSearchQueryExpressionValue = OrderSearchQueryExpressionValue.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 OrderSearchQueryExpressionValueBuilder implements Builder<OrderSearchQueryExpressionValue> { 025 026 private String field; 027 028 @Nullable 029 private Integer boost; 030 031 @Nullable 032 private String customType; 033 034 /** 035 * set the value to the field 036 * @param field value to be set 037 * @return Builder 038 */ 039 040 public OrderSearchQueryExpressionValueBuilder field(final String field) { 041 this.field = field; 042 return this; 043 } 044 045 /** 046 * set the value to the boost 047 * @param boost value to be set 048 * @return Builder 049 */ 050 051 public OrderSearchQueryExpressionValueBuilder boost(@Nullable final Integer boost) { 052 this.boost = boost; 053 return this; 054 } 055 056 /** 057 * set the value to the customType 058 * @param customType value to be set 059 * @return Builder 060 */ 061 062 public OrderSearchQueryExpressionValueBuilder customType(@Nullable final String customType) { 063 this.customType = customType; 064 return this; 065 } 066 067 /** 068 * value of field} 069 * @return field 070 */ 071 072 public String getField() { 073 return this.field; 074 } 075 076 /** 077 * value of boost} 078 * @return boost 079 */ 080 081 @Nullable 082 public Integer getBoost() { 083 return this.boost; 084 } 085 086 /** 087 * value of customType} 088 * @return customType 089 */ 090 091 @Nullable 092 public String getCustomType() { 093 return this.customType; 094 } 095 096 /** 097 * builds OrderSearchQueryExpressionValue with checking for non-null required values 098 * @return OrderSearchQueryExpressionValue 099 */ 100 public OrderSearchQueryExpressionValue build() { 101 Objects.requireNonNull(field, OrderSearchQueryExpressionValue.class + ": field is missing"); 102 return new OrderSearchQueryExpressionValueImpl(field, boost, customType); 103 } 104 105 /** 106 * builds OrderSearchQueryExpressionValue without checking for non-null required values 107 * @return OrderSearchQueryExpressionValue 108 */ 109 public OrderSearchQueryExpressionValue buildUnchecked() { 110 return new OrderSearchQueryExpressionValueImpl(field, boost, customType); 111 } 112 113 /** 114 * factory method for an instance of OrderSearchQueryExpressionValueBuilder 115 * @return builder 116 */ 117 public static OrderSearchQueryExpressionValueBuilder of() { 118 return new OrderSearchQueryExpressionValueBuilder(); 119 } 120 121 /** 122 * create builder for OrderSearchQueryExpressionValue instance 123 * @param template instance with prefilled values for the builder 124 * @return builder 125 */ 126 public static OrderSearchQueryExpressionValueBuilder of(final OrderSearchQueryExpressionValue template) { 127 OrderSearchQueryExpressionValueBuilder builder = new OrderSearchQueryExpressionValueBuilder(); 128 builder.field = template.getField(); 129 builder.boost = template.getBoost(); 130 builder.customType = template.getCustomType(); 131 return builder; 132 } 133 134}