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