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