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 * SetLineItemDeactivatedAtChangeBuilder
012 * <hr>
013 * Example to create an instance using the builder pattern
014 * <div class=code-example>
015 * <pre><code class='java'>
016 *     SetLineItemDeactivatedAtChange setLineItemDeactivatedAtChange = SetLineItemDeactivatedAtChange.builder()
017 *             .change("{change}")
018 *             .previousValue("{previousValue}")
019 *             .nextValue("{nextValue}")
020 *             .lineItem(lineItemBuilder -> lineItemBuilder)
021 *             .build()
022 * </code></pre>
023 * </div>
024 */
025@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
026public class SetLineItemDeactivatedAtChangeBuilder implements Builder<SetLineItemDeactivatedAtChange> {
027
028    private String change;
029
030    private String previousValue;
031
032    private String nextValue;
033
034    private com.commercetools.history.models.change_value.ShoppingListLineItemValue lineItem;
035
036    /**
037     * set the value to the change
038     * @param change value to be set
039     * @return Builder
040     */
041
042    public SetLineItemDeactivatedAtChangeBuilder change(final String change) {
043        this.change = change;
044        return this;
045    }
046
047    /**
048     *  <p>Value before the change.</p>
049     * @param previousValue value to be set
050     * @return Builder
051     */
052
053    public SetLineItemDeactivatedAtChangeBuilder previousValue(final String previousValue) {
054        this.previousValue = previousValue;
055        return this;
056    }
057
058    /**
059     *  <p>Value after the change.</p>
060     * @param nextValue value to be set
061     * @return Builder
062     */
063
064    public SetLineItemDeactivatedAtChangeBuilder nextValue(final String nextValue) {
065        this.nextValue = nextValue;
066        return this;
067    }
068
069    /**
070     *  <p>Holds information about the updated Shopping List Line Item.</p>
071     * @param builder function to build the lineItem value
072     * @return Builder
073     */
074
075    public SetLineItemDeactivatedAtChangeBuilder lineItem(
076            Function<com.commercetools.history.models.change_value.ShoppingListLineItemValueBuilder, com.commercetools.history.models.change_value.ShoppingListLineItemValueBuilder> builder) {
077        this.lineItem = builder
078                .apply(com.commercetools.history.models.change_value.ShoppingListLineItemValueBuilder.of())
079                .build();
080        return this;
081    }
082
083    /**
084     *  <p>Holds information about the updated Shopping List Line Item.</p>
085     * @param builder function to build the lineItem value
086     * @return Builder
087     */
088
089    public SetLineItemDeactivatedAtChangeBuilder withLineItem(
090            Function<com.commercetools.history.models.change_value.ShoppingListLineItemValueBuilder, com.commercetools.history.models.change_value.ShoppingListLineItemValue> builder) {
091        this.lineItem = builder
092                .apply(com.commercetools.history.models.change_value.ShoppingListLineItemValueBuilder.of());
093        return this;
094    }
095
096    /**
097     *  <p>Holds information about the updated Shopping List Line Item.</p>
098     * @param lineItem value to be set
099     * @return Builder
100     */
101
102    public SetLineItemDeactivatedAtChangeBuilder lineItem(
103            final com.commercetools.history.models.change_value.ShoppingListLineItemValue lineItem) {
104        this.lineItem = lineItem;
105        return this;
106    }
107
108    /**
109     * value of change}
110     * @return change
111     */
112
113    public String getChange() {
114        return this.change;
115    }
116
117    /**
118     *  <p>Value before the change.</p>
119     * @return previousValue
120     */
121
122    public String getPreviousValue() {
123        return this.previousValue;
124    }
125
126    /**
127     *  <p>Value after the change.</p>
128     * @return nextValue
129     */
130
131    public String getNextValue() {
132        return this.nextValue;
133    }
134
135    /**
136     *  <p>Holds information about the updated Shopping List Line Item.</p>
137     * @return lineItem
138     */
139
140    public com.commercetools.history.models.change_value.ShoppingListLineItemValue getLineItem() {
141        return this.lineItem;
142    }
143
144    /**
145     * builds SetLineItemDeactivatedAtChange with checking for non-null required values
146     * @return SetLineItemDeactivatedAtChange
147     */
148    public SetLineItemDeactivatedAtChange build() {
149        Objects.requireNonNull(change, SetLineItemDeactivatedAtChange.class + ": change is missing");
150        Objects.requireNonNull(previousValue, SetLineItemDeactivatedAtChange.class + ": previousValue is missing");
151        Objects.requireNonNull(nextValue, SetLineItemDeactivatedAtChange.class + ": nextValue is missing");
152        Objects.requireNonNull(lineItem, SetLineItemDeactivatedAtChange.class + ": lineItem is missing");
153        return new SetLineItemDeactivatedAtChangeImpl(change, previousValue, nextValue, lineItem);
154    }
155
156    /**
157     * builds SetLineItemDeactivatedAtChange without checking for non-null required values
158     * @return SetLineItemDeactivatedAtChange
159     */
160    public SetLineItemDeactivatedAtChange buildUnchecked() {
161        return new SetLineItemDeactivatedAtChangeImpl(change, previousValue, nextValue, lineItem);
162    }
163
164    /**
165     * factory method for an instance of SetLineItemDeactivatedAtChangeBuilder
166     * @return builder
167     */
168    public static SetLineItemDeactivatedAtChangeBuilder of() {
169        return new SetLineItemDeactivatedAtChangeBuilder();
170    }
171
172    /**
173     * create builder for SetLineItemDeactivatedAtChange instance
174     * @param template instance with prefilled values for the builder
175     * @return builder
176     */
177    public static SetLineItemDeactivatedAtChangeBuilder of(final SetLineItemDeactivatedAtChange template) {
178        SetLineItemDeactivatedAtChangeBuilder builder = new SetLineItemDeactivatedAtChangeBuilder();
179        builder.change = template.getChange();
180        builder.previousValue = template.getPreviousValue();
181        builder.nextValue = template.getNextValue();
182        builder.lineItem = template.getLineItem();
183        return builder;
184    }
185
186}