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