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 Remove EnumValues from AttributeDefinition update action.</p>
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     RemoveLocalizedEnumValuesChange removeLocalizedEnumValuesChange = RemoveLocalizedEnumValuesChange.builder()
026 *             .change("{change}")
027 *             .previousValue(previousValueBuilder -> previousValueBuilder)
028 *             .attributeName("{attributeName}")
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 = RemoveLocalizedEnumValuesChangeImpl.class)
035public interface RemoveLocalizedEnumValuesChange extends Change {
036
037    /**
038     * discriminator value for RemoveLocalizedEnumValuesChange
039     */
040    String REMOVE_LOCALIZED_ENUM_VALUES_CHANGE = "RemoveLocalizedEnumValuesChange";
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    @Valid
064    @JsonProperty("previousValue")
065    public LocalizedEnumValue getPreviousValue();
066
067    /**
068     *  <p>Name of the updated AttributeDefinition.</p>
069     * @return attributeName
070     */
071    @NotNull
072    @JsonProperty("attributeName")
073    public String getAttributeName();
074
075    /**
076     * set change
077     * @param change value to be set
078     */
079
080    public void setChange(final String change);
081
082    /**
083     *  <p>Value before the change.</p>
084     * @param previousValue value to be set
085     */
086
087    public void setPreviousValue(final LocalizedEnumValue previousValue);
088
089    /**
090     *  <p>Name of the updated AttributeDefinition.</p>
091     * @param attributeName value to be set
092     */
093
094    public void setAttributeName(final String attributeName);
095
096    /**
097     * factory method
098     * @return instance of RemoveLocalizedEnumValuesChange
099     */
100    public static RemoveLocalizedEnumValuesChange of() {
101        return new RemoveLocalizedEnumValuesChangeImpl();
102    }
103
104    /**
105     * factory method to create a shallow copy RemoveLocalizedEnumValuesChange
106     * @param template instance to be copied
107     * @return copy instance
108     */
109    public static RemoveLocalizedEnumValuesChange of(final RemoveLocalizedEnumValuesChange template) {
110        RemoveLocalizedEnumValuesChangeImpl instance = new RemoveLocalizedEnumValuesChangeImpl();
111        instance.setChange(template.getChange());
112        instance.setPreviousValue(template.getPreviousValue());
113        instance.setAttributeName(template.getAttributeName());
114        return instance;
115    }
116
117    /**
118     * factory method to create a deep copy of RemoveLocalizedEnumValuesChange
119     * @param template instance to be copied
120     * @return copy instance
121     */
122    @Nullable
123    public static RemoveLocalizedEnumValuesChange deepCopy(@Nullable final RemoveLocalizedEnumValuesChange template) {
124        if (template == null) {
125            return null;
126        }
127        RemoveLocalizedEnumValuesChangeImpl instance = new RemoveLocalizedEnumValuesChangeImpl();
128        instance.setChange(template.getChange());
129        instance.setPreviousValue(
130            com.commercetools.history.models.change_value.LocalizedEnumValue.deepCopy(template.getPreviousValue()));
131        instance.setAttributeName(template.getAttributeName());
132        return instance;
133    }
134
135    /**
136     * builder factory method for RemoveLocalizedEnumValuesChange
137     * @return builder
138     */
139    public static RemoveLocalizedEnumValuesChangeBuilder builder() {
140        return RemoveLocalizedEnumValuesChangeBuilder.of();
141    }
142
143    /**
144     * create builder for RemoveLocalizedEnumValuesChange instance
145     * @param template instance with prefilled values for the builder
146     * @return builder
147     */
148    public static RemoveLocalizedEnumValuesChangeBuilder builder(final RemoveLocalizedEnumValuesChange template) {
149        return RemoveLocalizedEnumValuesChangeBuilder.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 withRemoveLocalizedEnumValuesChange(Function<RemoveLocalizedEnumValuesChange, 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<RemoveLocalizedEnumValuesChange> typeReference() {
167        return new com.fasterxml.jackson.core.type.TypeReference<RemoveLocalizedEnumValuesChange>() {
168            @Override
169            public String toString() {
170                return "TypeReference<RemoveLocalizedEnumValuesChange>";
171            }
172        };
173    }
174}