001
002package com.commercetools.history.models.change;
003
004import java.util.*;
005
006import io.vrap.rmf.base.client.Builder;
007import io.vrap.rmf.base.client.utils.Generated;
008
009/**
010 * SetValueChangeBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     SetValueChange setValueChange = SetValueChange.builder()
016 *             .change("{change}")
017 *             .build()
018 * </code></pre>
019 * </div>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class SetValueChangeBuilder implements Builder<SetValueChange> {
023
024    private String change;
025
026    private java.lang.Object previousValue;
027
028    private java.lang.Object nextValue;
029
030    /**
031     * set the value to the change
032     * @param change value to be set
033     * @return Builder
034     */
035
036    public SetValueChangeBuilder change(final String change) {
037        this.change = change;
038        return this;
039    }
040
041    /**
042     *  <p>Value before the change.</p>
043     * @param previousValue value to be set
044     * @return Builder
045     */
046
047    public SetValueChangeBuilder previousValue(final java.lang.Object previousValue) {
048        this.previousValue = previousValue;
049        return this;
050    }
051
052    /**
053     *  <p>Value after the change.</p>
054     * @param nextValue value to be set
055     * @return Builder
056     */
057
058    public SetValueChangeBuilder nextValue(final java.lang.Object nextValue) {
059        this.nextValue = nextValue;
060        return this;
061    }
062
063    /**
064     * value of change}
065     * @return change
066     */
067
068    public String getChange() {
069        return this.change;
070    }
071
072    /**
073     *  <p>Value before the change.</p>
074     * @return previousValue
075     */
076
077    public java.lang.Object getPreviousValue() {
078        return this.previousValue;
079    }
080
081    /**
082     *  <p>Value after the change.</p>
083     * @return nextValue
084     */
085
086    public java.lang.Object getNextValue() {
087        return this.nextValue;
088    }
089
090    /**
091     * builds SetValueChange with checking for non-null required values
092     * @return SetValueChange
093     */
094    public SetValueChange build() {
095        Objects.requireNonNull(change, SetValueChange.class + ": change is missing");
096        Objects.requireNonNull(previousValue, SetValueChange.class + ": previousValue is missing");
097        Objects.requireNonNull(nextValue, SetValueChange.class + ": nextValue is missing");
098        return new SetValueChangeImpl(change, previousValue, nextValue);
099    }
100
101    /**
102     * builds SetValueChange without checking for non-null required values
103     * @return SetValueChange
104     */
105    public SetValueChange buildUnchecked() {
106        return new SetValueChangeImpl(change, previousValue, nextValue);
107    }
108
109    /**
110     * factory method for an instance of SetValueChangeBuilder
111     * @return builder
112     */
113    public static SetValueChangeBuilder of() {
114        return new SetValueChangeBuilder();
115    }
116
117    /**
118     * create builder for SetValueChange instance
119     * @param template instance with prefilled values for the builder
120     * @return builder
121     */
122    public static SetValueChangeBuilder of(final SetValueChange template) {
123        SetValueChangeBuilder builder = new SetValueChangeBuilder();
124        builder.change = template.getChange();
125        builder.previousValue = template.getPreviousValue();
126        builder.nextValue = template.getNextValue();
127        return builder;
128    }
129
130}