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.EnumValue;
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 *     RemoveEnumValuesChange removeEnumValuesChange = RemoveEnumValuesChange.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 = RemoveEnumValuesChangeImpl.class)
035public interface RemoveEnumValuesChange extends Change {
036
037    /**
038     * discriminator value for RemoveEnumValuesChange
039     */
040    String REMOVE_ENUM_VALUES_CHANGE = "RemoveEnumValuesChange";
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 EnumValue 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 EnumValue 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 RemoveEnumValuesChange
099     */
100    public static RemoveEnumValuesChange of() {
101        return new RemoveEnumValuesChangeImpl();
102    }
103
104    /**
105     * factory method to create a shallow copy RemoveEnumValuesChange
106     * @param template instance to be copied
107     * @return copy instance
108     */
109    public static RemoveEnumValuesChange of(final RemoveEnumValuesChange template) {
110        RemoveEnumValuesChangeImpl instance = new RemoveEnumValuesChangeImpl();
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 RemoveEnumValuesChange
119     * @param template instance to be copied
120     * @return copy instance
121     */
122    @Nullable
123    public static RemoveEnumValuesChange deepCopy(@Nullable final RemoveEnumValuesChange template) {
124        if (template == null) {
125            return null;
126        }
127        RemoveEnumValuesChangeImpl instance = new RemoveEnumValuesChangeImpl();
128        instance.setChange(template.getChange());
129        instance.setPreviousValue(
130            com.commercetools.history.models.change_value.EnumValue.deepCopy(template.getPreviousValue()));
131        instance.setAttributeName(template.getAttributeName());
132        return instance;
133    }
134
135    /**
136     * builder factory method for RemoveEnumValuesChange
137     * @return builder
138     */
139    public static RemoveEnumValuesChangeBuilder builder() {
140        return RemoveEnumValuesChangeBuilder.of();
141    }
142
143    /**
144     * create builder for RemoveEnumValuesChange instance
145     * @param template instance with prefilled values for the builder
146     * @return builder
147     */
148    public static RemoveEnumValuesChangeBuilder builder(final RemoveEnumValuesChange template) {
149        return RemoveEnumValuesChangeBuilder.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 withRemoveEnumValuesChange(Function<RemoveEnumValuesChange, 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<RemoveEnumValuesChange> typeReference() {
167        return new com.fasterxml.jackson.core.type.TypeReference<RemoveEnumValuesChange>() {
168            @Override
169            public String toString() {
170                return "TypeReference<RemoveEnumValuesChange>";
171            }
172        };
173    }
174}