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.common.LocalizedString;
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 following update actions:</p>
020 *  <ul>
021 *   <li>Set CustomLineItem Custom Type on Orders.</li>
022 *   <li>Set CustomLineItem Custom Type on Staged Orders.</li>
023 *  </ul>
024 *
025 * <hr>
026 * Example to create an instance using the builder pattern
027 * <div class=code-example>
028 * <pre><code class='java'>
029 *     SetCustomLineItemCustomFieldChange setCustomLineItemCustomFieldChange = SetCustomLineItemCustomFieldChange.builder()
030 *             .change("{change}")
031 *             .name("{name}")
032 *             .customLineItem(customLineItemBuilder -> customLineItemBuilder)
033 *             .customLineItemId("{customLineItemId}")
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 = SetCustomLineItemCustomFieldChangeImpl.class)
040public interface SetCustomLineItemCustomFieldChange extends Change {
041
042    /**
043     * discriminator value for SetCustomLineItemCustomFieldChange
044     */
045    String SET_CUSTOM_LINE_ITEM_CUSTOM_FIELD_CHANGE = "SetCustomLineItemCustomFieldChange";
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 Object getPreviousValue();
070
071    /**
072     *  <p>Value after the change.</p>
073     * @return nextValue
074     */
075    @NotNull
076    @JsonProperty("nextValue")
077    public Object getNextValue();
078
079    /**
080     *  <p>Name of the Custom Field.</p>
081     * @return name
082     */
083    @NotNull
084    @JsonProperty("name")
085    public String getName();
086
087    /**
088     *  <p>Name of the updated CustomLineItem.</p>
089     * @return customLineItem
090     */
091    @NotNull
092    @Valid
093    @JsonProperty("customLineItem")
094    public LocalizedString getCustomLineItem();
095
096    /**
097     *  <p><code>id</code> of the updated CustomLineItem.</p>
098     * @return customLineItemId
099     */
100    @NotNull
101    @JsonProperty("customLineItemId")
102    public String getCustomLineItemId();
103
104    /**
105     * set change
106     * @param change value to be set
107     */
108
109    public void setChange(final String change);
110
111    /**
112     *  <p>Value before the change.</p>
113     * @param previousValue value to be set
114     */
115
116    public void setPreviousValue(final Object previousValue);
117
118    /**
119     *  <p>Value after the change.</p>
120     * @param nextValue value to be set
121     */
122
123    public void setNextValue(final Object nextValue);
124
125    /**
126     *  <p>Name of the Custom Field.</p>
127     * @param name value to be set
128     */
129
130    public void setName(final String name);
131
132    /**
133     *  <p>Name of the updated CustomLineItem.</p>
134     * @param customLineItem value to be set
135     */
136
137    public void setCustomLineItem(final LocalizedString customLineItem);
138
139    /**
140     *  <p><code>id</code> of the updated CustomLineItem.</p>
141     * @param customLineItemId value to be set
142     */
143
144    public void setCustomLineItemId(final String customLineItemId);
145
146    /**
147     * factory method
148     * @return instance of SetCustomLineItemCustomFieldChange
149     */
150    public static SetCustomLineItemCustomFieldChange of() {
151        return new SetCustomLineItemCustomFieldChangeImpl();
152    }
153
154    /**
155     * factory method to create a shallow copy SetCustomLineItemCustomFieldChange
156     * @param template instance to be copied
157     * @return copy instance
158     */
159    public static SetCustomLineItemCustomFieldChange of(final SetCustomLineItemCustomFieldChange template) {
160        SetCustomLineItemCustomFieldChangeImpl instance = new SetCustomLineItemCustomFieldChangeImpl();
161        instance.setChange(template.getChange());
162        instance.setPreviousValue(template.getPreviousValue());
163        instance.setNextValue(template.getNextValue());
164        instance.setName(template.getName());
165        instance.setCustomLineItem(template.getCustomLineItem());
166        instance.setCustomLineItemId(template.getCustomLineItemId());
167        return instance;
168    }
169
170    /**
171     * factory method to create a deep copy of SetCustomLineItemCustomFieldChange
172     * @param template instance to be copied
173     * @return copy instance
174     */
175    @Nullable
176    public static SetCustomLineItemCustomFieldChange deepCopy(
177            @Nullable final SetCustomLineItemCustomFieldChange template) {
178        if (template == null) {
179            return null;
180        }
181        SetCustomLineItemCustomFieldChangeImpl instance = new SetCustomLineItemCustomFieldChangeImpl();
182        instance.setChange(template.getChange());
183        instance.setPreviousValue(template.getPreviousValue());
184        instance.setNextValue(template.getNextValue());
185        instance.setName(template.getName());
186        instance.setCustomLineItem(
187            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getCustomLineItem()));
188        instance.setCustomLineItemId(template.getCustomLineItemId());
189        return instance;
190    }
191
192    /**
193     * builder factory method for SetCustomLineItemCustomFieldChange
194     * @return builder
195     */
196    public static SetCustomLineItemCustomFieldChangeBuilder builder() {
197        return SetCustomLineItemCustomFieldChangeBuilder.of();
198    }
199
200    /**
201     * create builder for SetCustomLineItemCustomFieldChange instance
202     * @param template instance with prefilled values for the builder
203     * @return builder
204     */
205    public static SetCustomLineItemCustomFieldChangeBuilder builder(final SetCustomLineItemCustomFieldChange template) {
206        return SetCustomLineItemCustomFieldChangeBuilder.of(template);
207    }
208
209    /**
210     * accessor map function
211     * @param <T> mapped type
212     * @param helper function to map the object
213     * @return mapped value
214     */
215    default <T> T withSetCustomLineItemCustomFieldChange(Function<SetCustomLineItemCustomFieldChange, T> helper) {
216        return helper.apply(this);
217    }
218
219    /**
220     * gives a TypeReference for usage with Jackson DataBind
221     * @return TypeReference
222     */
223    public static com.fasterxml.jackson.core.type.TypeReference<SetCustomLineItemCustomFieldChange> typeReference() {
224        return new com.fasterxml.jackson.core.type.TypeReference<SetCustomLineItemCustomFieldChange>() {
225            @Override
226            public String toString() {
227                return "TypeReference<SetCustomLineItemCustomFieldChange>";
228            }
229        };
230    }
231}