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.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.commercetools.history.models.common.LocalizedString;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 *  <p>Change triggered by the following update actions:</p>
020 *  <ul>
021 *   <li>Change AttributeDefinition Label on Product Types.</li>
022 *   <li>Change FieldDefinition Label on Types.</li>
023 *  </ul>
024 *
025 * <hr>
026 * Example to create an instance using the builder pattern
027 * <div class=code-example>
028 * <pre><code class='java'>
029 *     ChangeLabelChange changeLabelChange = ChangeLabelChange.builder()
030 *             .change("{change}")
031 *             .previousValue(previousValueBuilder -> previousValueBuilder)
032 *             .nextValue(nextValueBuilder -> nextValueBuilder)
033 *             .fieldName("{fieldName}")
034 *             .attributeName("{attributeName}")
035 *             .build()
036 * </code></pre>
037 * </div>
038 */
039@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
040@JsonDeserialize(as = ChangeLabelChangeImpl.class)
041public interface ChangeLabelChange extends Change {
042
043    /**
044     * discriminator value for ChangeLabelChange
045     */
046    String CHANGE_LABEL_CHANGE = "ChangeLabelChange";
047
048    /**
049     *
050     * @return type
051     */
052    @NotNull
053    @JsonProperty("type")
054    public String getType();
055
056    /**
057     *
058     * @return change
059     */
060    @NotNull
061    @JsonProperty("change")
062    public String getChange();
063
064    /**
065     *  <p>Value before the change.</p>
066     * @return previousValue
067     */
068    @NotNull
069    @Valid
070    @JsonProperty("previousValue")
071    public LocalizedString getPreviousValue();
072
073    /**
074     *  <p>Value after the change.</p>
075     * @return nextValue
076     */
077    @NotNull
078    @Valid
079    @JsonProperty("nextValue")
080    public LocalizedString getNextValue();
081
082    /**
083     *  <p>Name of the updated FieldDefinition; only present on changes to Types).</p>
084     * @return fieldName
085     */
086    @NotNull
087    @JsonProperty("fieldName")
088    public String getFieldName();
089
090    /**
091     *  <p>Name of the updated AttributeDefinition; only present on changes to Product Types.</p>
092     * @return attributeName
093     */
094    @NotNull
095    @JsonProperty("attributeName")
096    public String getAttributeName();
097
098    /**
099     * set change
100     * @param change value to be set
101     */
102
103    public void setChange(final String change);
104
105    /**
106     *  <p>Value before the change.</p>
107     * @param previousValue value to be set
108     */
109
110    public void setPreviousValue(final LocalizedString previousValue);
111
112    /**
113     *  <p>Value after the change.</p>
114     * @param nextValue value to be set
115     */
116
117    public void setNextValue(final LocalizedString nextValue);
118
119    /**
120     *  <p>Name of the updated FieldDefinition; only present on changes to Types).</p>
121     * @param fieldName value to be set
122     */
123
124    public void setFieldName(final String fieldName);
125
126    /**
127     *  <p>Name of the updated AttributeDefinition; only present on changes to Product Types.</p>
128     * @param attributeName value to be set
129     */
130
131    public void setAttributeName(final String attributeName);
132
133    /**
134     * factory method
135     * @return instance of ChangeLabelChange
136     */
137    public static ChangeLabelChange of() {
138        return new ChangeLabelChangeImpl();
139    }
140
141    /**
142     * factory method to create a shallow copy ChangeLabelChange
143     * @param template instance to be copied
144     * @return copy instance
145     */
146    public static ChangeLabelChange of(final ChangeLabelChange template) {
147        ChangeLabelChangeImpl instance = new ChangeLabelChangeImpl();
148        instance.setChange(template.getChange());
149        instance.setPreviousValue(template.getPreviousValue());
150        instance.setNextValue(template.getNextValue());
151        instance.setFieldName(template.getFieldName());
152        instance.setAttributeName(template.getAttributeName());
153        return instance;
154    }
155
156    /**
157     * factory method to create a deep copy of ChangeLabelChange
158     * @param template instance to be copied
159     * @return copy instance
160     */
161    @Nullable
162    public static ChangeLabelChange deepCopy(@Nullable final ChangeLabelChange template) {
163        if (template == null) {
164            return null;
165        }
166        ChangeLabelChangeImpl instance = new ChangeLabelChangeImpl();
167        instance.setChange(template.getChange());
168        instance.setPreviousValue(
169            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getPreviousValue()));
170        instance.setNextValue(
171            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getNextValue()));
172        instance.setFieldName(template.getFieldName());
173        instance.setAttributeName(template.getAttributeName());
174        return instance;
175    }
176
177    /**
178     * builder factory method for ChangeLabelChange
179     * @return builder
180     */
181    public static ChangeLabelChangeBuilder builder() {
182        return ChangeLabelChangeBuilder.of();
183    }
184
185    /**
186     * create builder for ChangeLabelChange instance
187     * @param template instance with prefilled values for the builder
188     * @return builder
189     */
190    public static ChangeLabelChangeBuilder builder(final ChangeLabelChange template) {
191        return ChangeLabelChangeBuilder.of(template);
192    }
193
194    /**
195     * accessor map function
196     * @param <T> mapped type
197     * @param helper function to map the object
198     * @return mapped value
199     */
200    default <T> T withChangeLabelChange(Function<ChangeLabelChange, T> helper) {
201        return helper.apply(this);
202    }
203
204    /**
205     * gives a TypeReference for usage with Jackson DataBind
206     * @return TypeReference
207     */
208    public static com.fasterxml.jackson.core.type.TypeReference<ChangeLabelChange> typeReference() {
209        return new com.fasterxml.jackson.core.type.TypeReference<ChangeLabelChange>() {
210            @Override
211            public String toString() {
212                return "TypeReference<ChangeLabelChange>";
213            }
214        };
215    }
216}