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.ShoppingListLineItemValue;
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 Set ShoppingListLineItem Custom Field 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 *     SetShoppingListLineItemCustomFieldChange setShoppingListLineItemCustomFieldChange = SetShoppingListLineItemCustomFieldChange.builder()
026 *             .change("{change}")
027 *             .name("{name}")
028 *             .customTypeId("{customTypeId}")
029 *             .lineItem(lineItemBuilder -> lineItemBuilder)
030 *             .build()
031 * </code></pre>
032 * </div>
033 */
034@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
035@JsonDeserialize(as = SetShoppingListLineItemCustomFieldChangeImpl.class)
036public interface SetShoppingListLineItemCustomFieldChange extends Change {
037
038    /**
039     * discriminator value for SetShoppingListLineItemCustomFieldChange
040     */
041    String SET_SHOPPING_LIST_LINE_ITEM_CUSTOM_FIELD_CHANGE = "SetShoppingListLineItemCustomFieldChange";
042
043    /**
044     *
045     * @return type
046     */
047    @NotNull
048    @JsonProperty("type")
049    public String getType();
050
051    /**
052     *
053     * @return change
054     */
055    @NotNull
056    @JsonProperty("change")
057    public String getChange();
058
059    /**
060     *  <p>Value before the change.</p>
061     * @return previousValue
062     */
063    @NotNull
064    @JsonProperty("previousValue")
065    public Object getPreviousValue();
066
067    /**
068     *  <p>Value after the change.</p>
069     * @return nextValue
070     */
071    @NotNull
072    @JsonProperty("nextValue")
073    public Object getNextValue();
074
075    /**
076     *  <p>Name of the Custom Field.</p>
077     * @return name
078     */
079    @NotNull
080    @JsonProperty("name")
081    public String getName();
082
083    /**
084     *  <p><code>id</code> of the referenced Type.</p>
085     * @return customTypeId
086     */
087    @NotNull
088    @JsonProperty("customTypeId")
089    public String getCustomTypeId();
090
091    /**
092     *  <p>Holds information about the updated Shopping List Line Item.</p>
093     * @return lineItem
094     */
095    @NotNull
096    @Valid
097    @JsonProperty("lineItem")
098    public ShoppingListLineItemValue getLineItem();
099
100    /**
101     * set change
102     * @param change value to be set
103     */
104
105    public void setChange(final String change);
106
107    /**
108     *  <p>Value before the change.</p>
109     * @param previousValue value to be set
110     */
111
112    public void setPreviousValue(final Object previousValue);
113
114    /**
115     *  <p>Value after the change.</p>
116     * @param nextValue value to be set
117     */
118
119    public void setNextValue(final Object nextValue);
120
121    /**
122     *  <p>Name of the Custom Field.</p>
123     * @param name value to be set
124     */
125
126    public void setName(final String name);
127
128    /**
129     *  <p><code>id</code> of the referenced Type.</p>
130     * @param customTypeId value to be set
131     */
132
133    public void setCustomTypeId(final String customTypeId);
134
135    /**
136     *  <p>Holds information about the updated Shopping List Line Item.</p>
137     * @param lineItem value to be set
138     */
139
140    public void setLineItem(final ShoppingListLineItemValue lineItem);
141
142    /**
143     * factory method
144     * @return instance of SetShoppingListLineItemCustomFieldChange
145     */
146    public static SetShoppingListLineItemCustomFieldChange of() {
147        return new SetShoppingListLineItemCustomFieldChangeImpl();
148    }
149
150    /**
151     * factory method to create a shallow copy SetShoppingListLineItemCustomFieldChange
152     * @param template instance to be copied
153     * @return copy instance
154     */
155    public static SetShoppingListLineItemCustomFieldChange of(final SetShoppingListLineItemCustomFieldChange template) {
156        SetShoppingListLineItemCustomFieldChangeImpl instance = new SetShoppingListLineItemCustomFieldChangeImpl();
157        instance.setChange(template.getChange());
158        instance.setPreviousValue(template.getPreviousValue());
159        instance.setNextValue(template.getNextValue());
160        instance.setName(template.getName());
161        instance.setCustomTypeId(template.getCustomTypeId());
162        instance.setLineItem(template.getLineItem());
163        return instance;
164    }
165
166    /**
167     * factory method to create a deep copy of SetShoppingListLineItemCustomFieldChange
168     * @param template instance to be copied
169     * @return copy instance
170     */
171    @Nullable
172    public static SetShoppingListLineItemCustomFieldChange deepCopy(
173            @Nullable final SetShoppingListLineItemCustomFieldChange template) {
174        if (template == null) {
175            return null;
176        }
177        SetShoppingListLineItemCustomFieldChangeImpl instance = new SetShoppingListLineItemCustomFieldChangeImpl();
178        instance.setChange(template.getChange());
179        instance.setPreviousValue(template.getPreviousValue());
180        instance.setNextValue(template.getNextValue());
181        instance.setName(template.getName());
182        instance.setCustomTypeId(template.getCustomTypeId());
183        instance.setLineItem(
184            com.commercetools.history.models.change_value.ShoppingListLineItemValue.deepCopy(template.getLineItem()));
185        return instance;
186    }
187
188    /**
189     * builder factory method for SetShoppingListLineItemCustomFieldChange
190     * @return builder
191     */
192    public static SetShoppingListLineItemCustomFieldChangeBuilder builder() {
193        return SetShoppingListLineItemCustomFieldChangeBuilder.of();
194    }
195
196    /**
197     * create builder for SetShoppingListLineItemCustomFieldChange instance
198     * @param template instance with prefilled values for the builder
199     * @return builder
200     */
201    public static SetShoppingListLineItemCustomFieldChangeBuilder builder(
202            final SetShoppingListLineItemCustomFieldChange template) {
203        return SetShoppingListLineItemCustomFieldChangeBuilder.of(template);
204    }
205
206    /**
207     * accessor map function
208     * @param <T> mapped type
209     * @param helper function to map the object
210     * @return mapped value
211     */
212    default <T> T withSetShoppingListLineItemCustomFieldChange(
213            Function<SetShoppingListLineItemCustomFieldChange, T> helper) {
214        return helper.apply(this);
215    }
216
217    /**
218     * gives a TypeReference for usage with Jackson DataBind
219     * @return TypeReference
220     */
221    public static com.fasterxml.jackson.core.type.TypeReference<SetShoppingListLineItemCustomFieldChange> typeReference() {
222        return new com.fasterxml.jackson.core.type.TypeReference<SetShoppingListLineItemCustomFieldChange>() {
223            @Override
224            public String toString() {
225                return "TypeReference<SetShoppingListLineItemCustomFieldChange>";
226            }
227        };
228    }
229}