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