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 Change the label of an EnumValue update action.</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 *     ChangePlainEnumValueLabelChange changePlainEnumValueLabelChange = ChangePlainEnumValueLabelChange.builder()
024 *             .change("{change}")
025 *             .previousValue("{previousValue}")
026 *             .nextValue("{nextValue}")
027 *             .attributeName("{attributeName}")
028 *             .valueKey("{valueKey}")
029 *             .build()
030 * </code></pre>
031 * </div>
032 */
033@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
034@JsonDeserialize(as = ChangePlainEnumValueLabelChangeImpl.class)
035public interface ChangePlainEnumValueLabelChange extends Change {
036
037    /**
038     * discriminator value for ChangePlainEnumValueLabelChange
039     */
040    String CHANGE_PLAIN_ENUM_VALUE_LABEL_CHANGE = "ChangePlainEnumValueLabelChange";
041
042    /**
043     *
044     * @return type
045     */
046    @NotNull
047    @JsonProperty("type")
048    public String getType();
049
050    /**
051     *
052     * @return change
053     */
054    @NotNull
055    @JsonProperty("change")
056    public String getChange();
057
058    /**
059     *  <p>Value before the change.</p>
060     * @return previousValue
061     */
062    @NotNull
063    @JsonProperty("previousValue")
064    public String getPreviousValue();
065
066    /**
067     *  <p>Value after the change.</p>
068     * @return nextValue
069     */
070    @NotNull
071    @JsonProperty("nextValue")
072    public String getNextValue();
073
074    /**
075     *  <p>Name of the updated AttributeDefinition.</p>
076     * @return attributeName
077     */
078    @NotNull
079    @JsonProperty("attributeName")
080    public String getAttributeName();
081
082    /**
083     *  <p>Key of the updated values.</p>
084     * @return valueKey
085     */
086    @NotNull
087    @JsonProperty("valueKey")
088    public String getValueKey();
089
090    /**
091     * set change
092     * @param change value to be set
093     */
094
095    public void setChange(final String change);
096
097    /**
098     *  <p>Value before the change.</p>
099     * @param previousValue value to be set
100     */
101
102    public void setPreviousValue(final String previousValue);
103
104    /**
105     *  <p>Value after the change.</p>
106     * @param nextValue value to be set
107     */
108
109    public void setNextValue(final String nextValue);
110
111    /**
112     *  <p>Name of the updated AttributeDefinition.</p>
113     * @param attributeName value to be set
114     */
115
116    public void setAttributeName(final String attributeName);
117
118    /**
119     *  <p>Key of the updated values.</p>
120     * @param valueKey value to be set
121     */
122
123    public void setValueKey(final String valueKey);
124
125    /**
126     * factory method
127     * @return instance of ChangePlainEnumValueLabelChange
128     */
129    public static ChangePlainEnumValueLabelChange of() {
130        return new ChangePlainEnumValueLabelChangeImpl();
131    }
132
133    /**
134     * factory method to create a shallow copy ChangePlainEnumValueLabelChange
135     * @param template instance to be copied
136     * @return copy instance
137     */
138    public static ChangePlainEnumValueLabelChange of(final ChangePlainEnumValueLabelChange template) {
139        ChangePlainEnumValueLabelChangeImpl instance = new ChangePlainEnumValueLabelChangeImpl();
140        instance.setChange(template.getChange());
141        instance.setPreviousValue(template.getPreviousValue());
142        instance.setNextValue(template.getNextValue());
143        instance.setAttributeName(template.getAttributeName());
144        instance.setValueKey(template.getValueKey());
145        return instance;
146    }
147
148    /**
149     * factory method to create a deep copy of ChangePlainEnumValueLabelChange
150     * @param template instance to be copied
151     * @return copy instance
152     */
153    @Nullable
154    public static ChangePlainEnumValueLabelChange deepCopy(@Nullable final ChangePlainEnumValueLabelChange template) {
155        if (template == null) {
156            return null;
157        }
158        ChangePlainEnumValueLabelChangeImpl instance = new ChangePlainEnumValueLabelChangeImpl();
159        instance.setChange(template.getChange());
160        instance.setPreviousValue(template.getPreviousValue());
161        instance.setNextValue(template.getNextValue());
162        instance.setAttributeName(template.getAttributeName());
163        instance.setValueKey(template.getValueKey());
164        return instance;
165    }
166
167    /**
168     * builder factory method for ChangePlainEnumValueLabelChange
169     * @return builder
170     */
171    public static ChangePlainEnumValueLabelChangeBuilder builder() {
172        return ChangePlainEnumValueLabelChangeBuilder.of();
173    }
174
175    /**
176     * create builder for ChangePlainEnumValueLabelChange instance
177     * @param template instance with prefilled values for the builder
178     * @return builder
179     */
180    public static ChangePlainEnumValueLabelChangeBuilder builder(final ChangePlainEnumValueLabelChange template) {
181        return ChangePlainEnumValueLabelChangeBuilder.of(template);
182    }
183
184    /**
185     * accessor map function
186     * @param <T> mapped type
187     * @param helper function to map the object
188     * @return mapped value
189     */
190    default <T> T withChangePlainEnumValueLabelChange(Function<ChangePlainEnumValueLabelChange, T> helper) {
191        return helper.apply(this);
192    }
193
194    /**
195     * gives a TypeReference for usage with Jackson DataBind
196     * @return TypeReference
197     */
198    public static com.fasterxml.jackson.core.type.TypeReference<ChangePlainEnumValueLabelChange> typeReference() {
199        return new com.fasterxml.jackson.core.type.TypeReference<ChangePlainEnumValueLabelChange>() {
200            @Override
201            public String toString() {
202                return "TypeReference<ChangePlainEnumValueLabelChange>";
203            }
204        };
205    }
206}