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 following update actions:</p>
018 *  <ul>
019 *   <li>Change Description on Channels.</li>
020 *   <li>Change Description on Product Types.</li>
021 *  </ul>
022 *
023 * <hr>
024 * Example to create an instance using the builder pattern
025 * <div class=code-example>
026 * <pre><code class='java'>
027 *     ChangeDescriptionChange changeDescriptionChange = ChangeDescriptionChange.builder()
028 *             .change("{change}")
029 *             .previousValue("{previousValue}")
030 *             .nextValue("{nextValue}")
031 *             .build()
032 * </code></pre>
033 * </div>
034 */
035@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
036@JsonDeserialize(as = ChangeDescriptionChangeImpl.class)
037public interface ChangeDescriptionChange extends Change {
038
039    /**
040     * discriminator value for ChangeDescriptionChange
041     */
042    String CHANGE_DESCRIPTION_CHANGE = "ChangeDescriptionChange";
043
044    /**
045     *
046     * @return type
047     */
048    @NotNull
049    @JsonProperty("type")
050    public String getType();
051
052    /**
053     *
054     * @return change
055     */
056    @NotNull
057    @JsonProperty("change")
058    public String getChange();
059
060    /**
061     *  <p>Value before the change.</p>
062     * @return previousValue
063     */
064    @NotNull
065    @JsonProperty("previousValue")
066    public String getPreviousValue();
067
068    /**
069     *  <p>Value after the change.</p>
070     * @return nextValue
071     */
072    @NotNull
073    @JsonProperty("nextValue")
074    public String getNextValue();
075
076    /**
077     * set change
078     * @param change value to be set
079     */
080
081    public void setChange(final String change);
082
083    /**
084     *  <p>Value before the change.</p>
085     * @param previousValue value to be set
086     */
087
088    public void setPreviousValue(final String previousValue);
089
090    /**
091     *  <p>Value after the change.</p>
092     * @param nextValue value to be set
093     */
094
095    public void setNextValue(final String nextValue);
096
097    /**
098     * factory method
099     * @return instance of ChangeDescriptionChange
100     */
101    public static ChangeDescriptionChange of() {
102        return new ChangeDescriptionChangeImpl();
103    }
104
105    /**
106     * factory method to create a shallow copy ChangeDescriptionChange
107     * @param template instance to be copied
108     * @return copy instance
109     */
110    public static ChangeDescriptionChange of(final ChangeDescriptionChange template) {
111        ChangeDescriptionChangeImpl instance = new ChangeDescriptionChangeImpl();
112        instance.setChange(template.getChange());
113        instance.setPreviousValue(template.getPreviousValue());
114        instance.setNextValue(template.getNextValue());
115        return instance;
116    }
117
118    /**
119     * factory method to create a deep copy of ChangeDescriptionChange
120     * @param template instance to be copied
121     * @return copy instance
122     */
123    @Nullable
124    public static ChangeDescriptionChange deepCopy(@Nullable final ChangeDescriptionChange template) {
125        if (template == null) {
126            return null;
127        }
128        ChangeDescriptionChangeImpl instance = new ChangeDescriptionChangeImpl();
129        instance.setChange(template.getChange());
130        instance.setPreviousValue(template.getPreviousValue());
131        instance.setNextValue(template.getNextValue());
132        return instance;
133    }
134
135    /**
136     * builder factory method for ChangeDescriptionChange
137     * @return builder
138     */
139    public static ChangeDescriptionChangeBuilder builder() {
140        return ChangeDescriptionChangeBuilder.of();
141    }
142
143    /**
144     * create builder for ChangeDescriptionChange instance
145     * @param template instance with prefilled values for the builder
146     * @return builder
147     */
148    public static ChangeDescriptionChangeBuilder builder(final ChangeDescriptionChange template) {
149        return ChangeDescriptionChangeBuilder.of(template);
150    }
151
152    /**
153     * accessor map function
154     * @param <T> mapped type
155     * @param helper function to map the object
156     * @return mapped value
157     */
158    default <T> T withChangeDescriptionChange(Function<ChangeDescriptionChange, T> helper) {
159        return helper.apply(this);
160    }
161
162    /**
163     * gives a TypeReference for usage with Jackson DataBind
164     * @return TypeReference
165     */
166    public static com.fasterxml.jackson.core.type.TypeReference<ChangeDescriptionChange> typeReference() {
167        return new com.fasterxml.jackson.core.type.TypeReference<ChangeDescriptionChange>() {
168            @Override
169            public String toString() {
170                return "TypeReference<ChangeDescriptionChange>";
171            }
172        };
173    }
174}