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