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