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 * ChangeQuoteStateChangeBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     ChangeQuoteStateChange changeQuoteStateChange = ChangeQuoteStateChange.builder()
016 *             .change("{change}")
017 *             .previousValue(QuoteState.PENDING)
018 *             .nextValue(QuoteState.PENDING)
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 ChangeQuoteStateChangeBuilder implements Builder<ChangeQuoteStateChange> {
025
026    private String change;
027
028    private com.commercetools.history.models.common.QuoteState previousValue;
029
030    private com.commercetools.history.models.common.QuoteState nextValue;
031
032    /**
033     * set the value to the change
034     * @param change value to be set
035     * @return Builder
036     */
037
038    public ChangeQuoteStateChangeBuilder 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 ChangeQuoteStateChangeBuilder previousValue(
050            final com.commercetools.history.models.common.QuoteState 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 ChangeQuoteStateChangeBuilder nextValue(final com.commercetools.history.models.common.QuoteState 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.QuoteState 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.QuoteState getNextValue() {
090        return this.nextValue;
091    }
092
093    /**
094     * builds ChangeQuoteStateChange with checking for non-null required values
095     * @return ChangeQuoteStateChange
096     */
097    public ChangeQuoteStateChange build() {
098        Objects.requireNonNull(change, ChangeQuoteStateChange.class + ": change is missing");
099        Objects.requireNonNull(previousValue, ChangeQuoteStateChange.class + ": previousValue is missing");
100        Objects.requireNonNull(nextValue, ChangeQuoteStateChange.class + ": nextValue is missing");
101        return new ChangeQuoteStateChangeImpl(change, previousValue, nextValue);
102    }
103
104    /**
105     * builds ChangeQuoteStateChange without checking for non-null required values
106     * @return ChangeQuoteStateChange
107     */
108    public ChangeQuoteStateChange buildUnchecked() {
109        return new ChangeQuoteStateChangeImpl(change, previousValue, nextValue);
110    }
111
112    /**
113     * factory method for an instance of ChangeQuoteStateChangeBuilder
114     * @return builder
115     */
116    public static ChangeQuoteStateChangeBuilder of() {
117        return new ChangeQuoteStateChangeBuilder();
118    }
119
120    /**
121     * create builder for ChangeQuoteStateChange instance
122     * @param template instance with prefilled values for the builder
123     * @return builder
124     */
125    public static ChangeQuoteStateChangeBuilder of(final ChangeQuoteStateChange template) {
126        ChangeQuoteStateChangeBuilder builder = new ChangeQuoteStateChangeBuilder();
127        builder.change = template.getChange();
128        builder.previousValue = template.getPreviousValue();
129        builder.nextValue = template.getNextValue();
130        return builder;
131    }
132
133}