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