001
002package com.commercetools.history.models.change;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.constraints.NotNull;
010
011import com.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 *  <p>Change triggered by the Update CustomObject request when a new property is added.</p>
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     AddPropertyChange addPropertyChange = AddPropertyChange.builder()
024 *             .change("{change}")
025 *             .path("{path}")
026 *             .build()
027 * </code></pre>
028 * </div>
029 */
030@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
031@JsonDeserialize(as = AddPropertyChangeImpl.class)
032public interface AddPropertyChange extends Change {
033
034    /**
035     * discriminator value for AddPropertyChange
036     */
037    String ADD_PROPERTY_CHANGE = "AddPropertyChange";
038
039    /**
040     *
041     * @return type
042     */
043    @NotNull
044    @JsonProperty("type")
045    public String getType();
046
047    /**
048     *
049     * @return change
050     */
051    @NotNull
052    @JsonProperty("change")
053    public String getChange();
054
055    /**
056     *  <p>Value after the change.</p>
057     * @return nextValue
058     */
059    @NotNull
060    @JsonProperty("nextValue")
061    public Object getNextValue();
062
063    /**
064     *  <p>Path to the new property that was added.</p>
065     * @return path
066     */
067    @NotNull
068    @JsonProperty("path")
069    public String getPath();
070
071    /**
072     * set change
073     * @param change value to be set
074     */
075
076    public void setChange(final String change);
077
078    /**
079     *  <p>Value after the change.</p>
080     * @param nextValue value to be set
081     */
082
083    public void setNextValue(final Object nextValue);
084
085    /**
086     *  <p>Path to the new property that was added.</p>
087     * @param path value to be set
088     */
089
090    public void setPath(final String path);
091
092    /**
093     * factory method
094     * @return instance of AddPropertyChange
095     */
096    public static AddPropertyChange of() {
097        return new AddPropertyChangeImpl();
098    }
099
100    /**
101     * factory method to create a shallow copy AddPropertyChange
102     * @param template instance to be copied
103     * @return copy instance
104     */
105    public static AddPropertyChange of(final AddPropertyChange template) {
106        AddPropertyChangeImpl instance = new AddPropertyChangeImpl();
107        instance.setChange(template.getChange());
108        instance.setNextValue(template.getNextValue());
109        instance.setPath(template.getPath());
110        return instance;
111    }
112
113    /**
114     * factory method to create a deep copy of AddPropertyChange
115     * @param template instance to be copied
116     * @return copy instance
117     */
118    @Nullable
119    public static AddPropertyChange deepCopy(@Nullable final AddPropertyChange template) {
120        if (template == null) {
121            return null;
122        }
123        AddPropertyChangeImpl instance = new AddPropertyChangeImpl();
124        instance.setChange(template.getChange());
125        instance.setNextValue(template.getNextValue());
126        instance.setPath(template.getPath());
127        return instance;
128    }
129
130    /**
131     * builder factory method for AddPropertyChange
132     * @return builder
133     */
134    public static AddPropertyChangeBuilder builder() {
135        return AddPropertyChangeBuilder.of();
136    }
137
138    /**
139     * create builder for AddPropertyChange instance
140     * @param template instance with prefilled values for the builder
141     * @return builder
142     */
143    public static AddPropertyChangeBuilder builder(final AddPropertyChange template) {
144        return AddPropertyChangeBuilder.of(template);
145    }
146
147    /**
148     * accessor map function
149     * @param <T> mapped type
150     * @param helper function to map the object
151     * @return mapped value
152     */
153    default <T> T withAddPropertyChange(Function<AddPropertyChange, T> helper) {
154        return helper.apply(this);
155    }
156
157    /**
158     * gives a TypeReference for usage with Jackson DataBind
159     * @return TypeReference
160     */
161    public static com.fasterxml.jackson.core.type.TypeReference<AddPropertyChange> typeReference() {
162        return new com.fasterxml.jackson.core.type.TypeReference<AddPropertyChange>() {
163            @Override
164            public String toString() {
165                return "TypeReference<AddPropertyChange>";
166            }
167        };
168    }
169}