001
002package com.commercetools.history.models.change;
003
004import java.util.*;
005import java.util.function.Function;
006
007import io.vrap.rmf.base.client.Builder;
008import io.vrap.rmf.base.client.utils.Generated;
009
010/**
011 * SetCustomLineItemTaxedPriceChangeBuilder
012 * <hr>
013 * Example to create an instance using the builder pattern
014 * <div class=code-example>
015 * <pre><code class='java'>
016 *     SetCustomLineItemTaxedPriceChange setCustomLineItemTaxedPriceChange = SetCustomLineItemTaxedPriceChange.builder()
017 *             .change("{change}")
018 *             .previousValue(previousValueBuilder -> previousValueBuilder)
019 *             .nextValue(nextValueBuilder -> nextValueBuilder)
020 *             .customLineItem(customLineItemBuilder -> customLineItemBuilder)
021 *             .customLineItemId("{customLineItemId}")
022 *             .build()
023 * </code></pre>
024 * </div>
025 */
026@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
027public class SetCustomLineItemTaxedPriceChangeBuilder implements Builder<SetCustomLineItemTaxedPriceChange> {
028
029    private String change;
030
031    private com.commercetools.history.models.common.Money previousValue;
032
033    private com.commercetools.history.models.common.Money nextValue;
034
035    private com.commercetools.history.models.common.LocalizedString customLineItem;
036
037    private String customLineItemId;
038
039    /**
040     * set the value to the change
041     * @param change value to be set
042     * @return Builder
043     */
044
045    public SetCustomLineItemTaxedPriceChangeBuilder change(final String change) {
046        this.change = change;
047        return this;
048    }
049
050    /**
051     *  <p>Value before the change.</p>
052     * @param builder function to build the previousValue value
053     * @return Builder
054     */
055
056    public SetCustomLineItemTaxedPriceChangeBuilder previousValue(
057            Function<com.commercetools.history.models.common.MoneyBuilder, com.commercetools.history.models.common.MoneyBuilder> builder) {
058        this.previousValue = builder.apply(com.commercetools.history.models.common.MoneyBuilder.of()).build();
059        return this;
060    }
061
062    /**
063     *  <p>Value before the change.</p>
064     * @param builder function to build the previousValue value
065     * @return Builder
066     */
067
068    public SetCustomLineItemTaxedPriceChangeBuilder withPreviousValue(
069            Function<com.commercetools.history.models.common.MoneyBuilder, com.commercetools.history.models.common.Money> builder) {
070        this.previousValue = builder.apply(com.commercetools.history.models.common.MoneyBuilder.of());
071        return this;
072    }
073
074    /**
075     *  <p>Value before the change.</p>
076     * @param previousValue value to be set
077     * @return Builder
078     */
079
080    public SetCustomLineItemTaxedPriceChangeBuilder previousValue(
081            final com.commercetools.history.models.common.Money previousValue) {
082        this.previousValue = previousValue;
083        return this;
084    }
085
086    /**
087     *  <p>Value after the change.</p>
088     * @param builder function to build the nextValue value
089     * @return Builder
090     */
091
092    public SetCustomLineItemTaxedPriceChangeBuilder nextValue(
093            Function<com.commercetools.history.models.common.MoneyBuilder, com.commercetools.history.models.common.MoneyBuilder> builder) {
094        this.nextValue = builder.apply(com.commercetools.history.models.common.MoneyBuilder.of()).build();
095        return this;
096    }
097
098    /**
099     *  <p>Value after the change.</p>
100     * @param builder function to build the nextValue value
101     * @return Builder
102     */
103
104    public SetCustomLineItemTaxedPriceChangeBuilder withNextValue(
105            Function<com.commercetools.history.models.common.MoneyBuilder, com.commercetools.history.models.common.Money> builder) {
106        this.nextValue = builder.apply(com.commercetools.history.models.common.MoneyBuilder.of());
107        return this;
108    }
109
110    /**
111     *  <p>Value after the change.</p>
112     * @param nextValue value to be set
113     * @return Builder
114     */
115
116    public SetCustomLineItemTaxedPriceChangeBuilder nextValue(
117            final com.commercetools.history.models.common.Money nextValue) {
118        this.nextValue = nextValue;
119        return this;
120    }
121
122    /**
123     *  <p>Name of the updated CustomLineItem.</p>
124     * @param builder function to build the customLineItem value
125     * @return Builder
126     */
127
128    public SetCustomLineItemTaxedPriceChangeBuilder customLineItem(
129            Function<com.commercetools.history.models.common.LocalizedStringBuilder, com.commercetools.history.models.common.LocalizedStringBuilder> builder) {
130        this.customLineItem = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of())
131                .build();
132        return this;
133    }
134
135    /**
136     *  <p>Name of the updated CustomLineItem.</p>
137     * @param builder function to build the customLineItem value
138     * @return Builder
139     */
140
141    public SetCustomLineItemTaxedPriceChangeBuilder withCustomLineItem(
142            Function<com.commercetools.history.models.common.LocalizedStringBuilder, com.commercetools.history.models.common.LocalizedString> builder) {
143        this.customLineItem = builder.apply(com.commercetools.history.models.common.LocalizedStringBuilder.of());
144        return this;
145    }
146
147    /**
148     *  <p>Name of the updated CustomLineItem.</p>
149     * @param customLineItem value to be set
150     * @return Builder
151     */
152
153    public SetCustomLineItemTaxedPriceChangeBuilder customLineItem(
154            final com.commercetools.history.models.common.LocalizedString customLineItem) {
155        this.customLineItem = customLineItem;
156        return this;
157    }
158
159    /**
160     *  <p><code>id</code> of the updated CustomLineItem.</p>
161     * @param customLineItemId value to be set
162     * @return Builder
163     */
164
165    public SetCustomLineItemTaxedPriceChangeBuilder customLineItemId(final String customLineItemId) {
166        this.customLineItemId = customLineItemId;
167        return this;
168    }
169
170    /**
171     * value of change}
172     * @return change
173     */
174
175    public String getChange() {
176        return this.change;
177    }
178
179    /**
180     *  <p>Value before the change.</p>
181     * @return previousValue
182     */
183
184    public com.commercetools.history.models.common.Money getPreviousValue() {
185        return this.previousValue;
186    }
187
188    /**
189     *  <p>Value after the change.</p>
190     * @return nextValue
191     */
192
193    public com.commercetools.history.models.common.Money getNextValue() {
194        return this.nextValue;
195    }
196
197    /**
198     *  <p>Name of the updated CustomLineItem.</p>
199     * @return customLineItem
200     */
201
202    public com.commercetools.history.models.common.LocalizedString getCustomLineItem() {
203        return this.customLineItem;
204    }
205
206    /**
207     *  <p><code>id</code> of the updated CustomLineItem.</p>
208     * @return customLineItemId
209     */
210
211    public String getCustomLineItemId() {
212        return this.customLineItemId;
213    }
214
215    /**
216     * builds SetCustomLineItemTaxedPriceChange with checking for non-null required values
217     * @return SetCustomLineItemTaxedPriceChange
218     */
219    public SetCustomLineItemTaxedPriceChange build() {
220        Objects.requireNonNull(change, SetCustomLineItemTaxedPriceChange.class + ": change is missing");
221        Objects.requireNonNull(previousValue, SetCustomLineItemTaxedPriceChange.class + ": previousValue is missing");
222        Objects.requireNonNull(nextValue, SetCustomLineItemTaxedPriceChange.class + ": nextValue is missing");
223        Objects.requireNonNull(customLineItem, SetCustomLineItemTaxedPriceChange.class + ": customLineItem is missing");
224        Objects.requireNonNull(customLineItemId,
225            SetCustomLineItemTaxedPriceChange.class + ": customLineItemId is missing");
226        return new SetCustomLineItemTaxedPriceChangeImpl(change, previousValue, nextValue, customLineItem,
227            customLineItemId);
228    }
229
230    /**
231     * builds SetCustomLineItemTaxedPriceChange without checking for non-null required values
232     * @return SetCustomLineItemTaxedPriceChange
233     */
234    public SetCustomLineItemTaxedPriceChange buildUnchecked() {
235        return new SetCustomLineItemTaxedPriceChangeImpl(change, previousValue, nextValue, customLineItem,
236            customLineItemId);
237    }
238
239    /**
240     * factory method for an instance of SetCustomLineItemTaxedPriceChangeBuilder
241     * @return builder
242     */
243    public static SetCustomLineItemTaxedPriceChangeBuilder of() {
244        return new SetCustomLineItemTaxedPriceChangeBuilder();
245    }
246
247    /**
248     * create builder for SetCustomLineItemTaxedPriceChange instance
249     * @param template instance with prefilled values for the builder
250     * @return builder
251     */
252    public static SetCustomLineItemTaxedPriceChangeBuilder of(final SetCustomLineItemTaxedPriceChange template) {
253        SetCustomLineItemTaxedPriceChangeBuilder builder = new SetCustomLineItemTaxedPriceChangeBuilder();
254        builder.change = template.getChange();
255        builder.previousValue = template.getPreviousValue();
256        builder.nextValue = template.getNextValue();
257        builder.customLineItem = template.getCustomLineItem();
258        builder.customLineItemId = template.getCustomLineItemId();
259        return builder;
260    }
261
262}