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