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.TextLineItemValue;
013import com.commercetools.history.models.common.LocalizedString;
014import com.fasterxml.jackson.annotation.*;
015import com.fasterxml.jackson.databind.annotation.*;
016
017import io.vrap.rmf.base.client.utils.Generated;
018
019/**
020 *  <p>Change triggered by the Set TextLineItem Description update action.</p>
021 *
022 * <hr>
023 * Example to create an instance using the builder pattern
024 * <div class=code-example>
025 * <pre><code class='java'>
026 *     SetTextLineItemDescriptionChange setTextLineItemDescriptionChange = SetTextLineItemDescriptionChange.builder()
027 *             .change("{change}")
028 *             .previousValue(previousValueBuilder -> previousValueBuilder)
029 *             .nextValue(nextValueBuilder -> nextValueBuilder)
030 *             .textLineItem(textLineItemBuilder -> textLineItemBuilder)
031 *             .build()
032 * </code></pre>
033 * </div>
034 */
035@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
036@JsonDeserialize(as = SetTextLineItemDescriptionChangeImpl.class)
037public interface SetTextLineItemDescriptionChange extends Change {
038
039    /**
040     * discriminator value for SetTextLineItemDescriptionChange
041     */
042    String SET_TEXT_LINE_ITEM_DESCRIPTION_CHANGE = "SetTextLineItemDescriptionChange";
043
044    /**
045     *
046     * @return type
047     */
048    @NotNull
049    @JsonProperty("type")
050    public String getType();
051
052    /**
053     *
054     * @return change
055     */
056    @NotNull
057    @JsonProperty("change")
058    public String getChange();
059
060    /**
061     *  <p>Value before the change.</p>
062     * @return previousValue
063     */
064    @NotNull
065    @Valid
066    @JsonProperty("previousValue")
067    public LocalizedString getPreviousValue();
068
069    /**
070     *  <p>Value after the change.</p>
071     * @return nextValue
072     */
073    @NotNull
074    @Valid
075    @JsonProperty("nextValue")
076    public LocalizedString getNextValue();
077
078    /**
079     *  <p>Holds information about the updated Text Line Item.</p>
080     * @return textLineItem
081     */
082    @NotNull
083    @Valid
084    @JsonProperty("textLineItem")
085    public TextLineItemValue getTextLineItem();
086
087    /**
088     * set change
089     * @param change value to be set
090     */
091
092    public void setChange(final String change);
093
094    /**
095     *  <p>Value before the change.</p>
096     * @param previousValue value to be set
097     */
098
099    public void setPreviousValue(final LocalizedString previousValue);
100
101    /**
102     *  <p>Value after the change.</p>
103     * @param nextValue value to be set
104     */
105
106    public void setNextValue(final LocalizedString nextValue);
107
108    /**
109     *  <p>Holds information about the updated Text Line Item.</p>
110     * @param textLineItem value to be set
111     */
112
113    public void setTextLineItem(final TextLineItemValue textLineItem);
114
115    /**
116     * factory method
117     * @return instance of SetTextLineItemDescriptionChange
118     */
119    public static SetTextLineItemDescriptionChange of() {
120        return new SetTextLineItemDescriptionChangeImpl();
121    }
122
123    /**
124     * factory method to create a shallow copy SetTextLineItemDescriptionChange
125     * @param template instance to be copied
126     * @return copy instance
127     */
128    public static SetTextLineItemDescriptionChange of(final SetTextLineItemDescriptionChange template) {
129        SetTextLineItemDescriptionChangeImpl instance = new SetTextLineItemDescriptionChangeImpl();
130        instance.setChange(template.getChange());
131        instance.setPreviousValue(template.getPreviousValue());
132        instance.setNextValue(template.getNextValue());
133        instance.setTextLineItem(template.getTextLineItem());
134        return instance;
135    }
136
137    /**
138     * factory method to create a deep copy of SetTextLineItemDescriptionChange
139     * @param template instance to be copied
140     * @return copy instance
141     */
142    @Nullable
143    public static SetTextLineItemDescriptionChange deepCopy(@Nullable final SetTextLineItemDescriptionChange template) {
144        if (template == null) {
145            return null;
146        }
147        SetTextLineItemDescriptionChangeImpl instance = new SetTextLineItemDescriptionChangeImpl();
148        instance.setChange(template.getChange());
149        instance.setPreviousValue(
150            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getPreviousValue()));
151        instance.setNextValue(
152            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getNextValue()));
153        instance.setTextLineItem(
154            com.commercetools.history.models.change_value.TextLineItemValue.deepCopy(template.getTextLineItem()));
155        return instance;
156    }
157
158    /**
159     * builder factory method for SetTextLineItemDescriptionChange
160     * @return builder
161     */
162    public static SetTextLineItemDescriptionChangeBuilder builder() {
163        return SetTextLineItemDescriptionChangeBuilder.of();
164    }
165
166    /**
167     * create builder for SetTextLineItemDescriptionChange instance
168     * @param template instance with prefilled values for the builder
169     * @return builder
170     */
171    public static SetTextLineItemDescriptionChangeBuilder builder(final SetTextLineItemDescriptionChange template) {
172        return SetTextLineItemDescriptionChangeBuilder.of(template);
173    }
174
175    /**
176     * accessor map function
177     * @param <T> mapped type
178     * @param helper function to map the object
179     * @return mapped value
180     */
181    default <T> T withSetTextLineItemDescriptionChange(Function<SetTextLineItemDescriptionChange, T> helper) {
182        return helper.apply(this);
183    }
184
185    /**
186     * gives a TypeReference for usage with Jackson DataBind
187     * @return TypeReference
188     */
189    public static com.fasterxml.jackson.core.type.TypeReference<SetTextLineItemDescriptionChange> typeReference() {
190        return new com.fasterxml.jackson.core.type.TypeReference<SetTextLineItemDescriptionChange>() {
191            @Override
192            public String toString() {
193                return "TypeReference<SetTextLineItemDescriptionChange>";
194            }
195        };
196    }
197}