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