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