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 * SetPropertyChangeBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     SetPropertyChange setPropertyChange = SetPropertyChange.builder()
016 *             .change("{change}")
017 *             .path("{path}")
018 *             .build()
019 * </code></pre>
020 * </div>
021 */
022@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
023public class SetPropertyChangeBuilder implements Builder<SetPropertyChange> {
024
025    private String change;
026
027    private java.lang.Object previousValue;
028
029    private java.lang.Object nextValue;
030
031    private String path;
032
033    /**
034     * set the value to the change
035     * @param change value to be set
036     * @return Builder
037     */
038
039    public SetPropertyChangeBuilder change(final String change) {
040        this.change = change;
041        return this;
042    }
043
044    /**
045     *  <p>Value before the change.</p>
046     * @param previousValue value to be set
047     * @return Builder
048     */
049
050    public SetPropertyChangeBuilder previousValue(final java.lang.Object 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 SetPropertyChangeBuilder nextValue(final java.lang.Object nextValue) {
062        this.nextValue = nextValue;
063        return this;
064    }
065
066    /**
067     *  <p>Path to the property that was updated.</p>
068     * @param path value to be set
069     * @return Builder
070     */
071
072    public SetPropertyChangeBuilder path(final String path) {
073        this.path = path;
074        return this;
075    }
076
077    /**
078     * value of change}
079     * @return change
080     */
081
082    public String getChange() {
083        return this.change;
084    }
085
086    /**
087     *  <p>Value before the change.</p>
088     * @return previousValue
089     */
090
091    public java.lang.Object getPreviousValue() {
092        return this.previousValue;
093    }
094
095    /**
096     *  <p>Value after the change.</p>
097     * @return nextValue
098     */
099
100    public java.lang.Object getNextValue() {
101        return this.nextValue;
102    }
103
104    /**
105     *  <p>Path to the property that was updated.</p>
106     * @return path
107     */
108
109    public String getPath() {
110        return this.path;
111    }
112
113    /**
114     * builds SetPropertyChange with checking for non-null required values
115     * @return SetPropertyChange
116     */
117    public SetPropertyChange build() {
118        Objects.requireNonNull(change, SetPropertyChange.class + ": change is missing");
119        Objects.requireNonNull(previousValue, SetPropertyChange.class + ": previousValue is missing");
120        Objects.requireNonNull(nextValue, SetPropertyChange.class + ": nextValue is missing");
121        Objects.requireNonNull(path, SetPropertyChange.class + ": path is missing");
122        return new SetPropertyChangeImpl(change, previousValue, nextValue, path);
123    }
124
125    /**
126     * builds SetPropertyChange without checking for non-null required values
127     * @return SetPropertyChange
128     */
129    public SetPropertyChange buildUnchecked() {
130        return new SetPropertyChangeImpl(change, previousValue, nextValue, path);
131    }
132
133    /**
134     * factory method for an instance of SetPropertyChangeBuilder
135     * @return builder
136     */
137    public static SetPropertyChangeBuilder of() {
138        return new SetPropertyChangeBuilder();
139    }
140
141    /**
142     * create builder for SetPropertyChange instance
143     * @param template instance with prefilled values for the builder
144     * @return builder
145     */
146    public static SetPropertyChangeBuilder of(final SetPropertyChange template) {
147        SetPropertyChangeBuilder builder = new SetPropertyChangeBuilder();
148        builder.change = template.getChange();
149        builder.previousValue = template.getPreviousValue();
150        builder.nextValue = template.getNextValue();
151        builder.path = template.getPath();
152        return builder;
153    }
154
155}