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.commercetools.history.models.change_value.SetCartClassificationShippingRateInputValue;
012import com.commercetools.history.models.change_value.SetCartScoreShippingRateInputValue;
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 Shipping Rate Input 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 *     SetShippingRateInputChange setShippingRateInputChange = SetShippingRateInputChange.builder()
026 *             .change("{change}")
027 *             .build()
028 * </code></pre>
029 * </div>
030 */
031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
032@JsonDeserialize(as = SetShippingRateInputChangeImpl.class)
033public interface SetShippingRateInputChange extends Change {
034
035    /**
036     * discriminator value for SetShippingRateInputChange
037     */
038    String SET_SHIPPING_RATE_INPUT_CHANGE = "SetShippingRateInputChange";
039
040    /**
041     *
042     * @return type
043     */
044    @NotNull
045    @JsonProperty("type")
046    public String getType();
047
048    /**
049     *
050     * @return change
051     */
052    @NotNull
053    @JsonProperty("change")
054    public String getChange();
055
056    /**
057     *  <p>Value before the change.</p>
058     * @return previousValue
059     */
060    @NotNull
061    @JsonProperty("previousValue")
062    public Object getPreviousValue();
063
064    /**
065     *  <p>Value after the change.</p>
066     * @return nextValue
067     */
068    @NotNull
069    @JsonProperty("nextValue")
070    public Object getNextValue();
071
072    /**
073     * set change
074     * @param change value to be set
075     */
076
077    public void setChange(final String change);
078
079    /**
080     *  <p>Value before the change.</p>
081     * @param previousValue value to be set
082     */
083
084    public void setPreviousValue(final SetCartClassificationShippingRateInputValue previousValue);
085
086    /**
087     *  <p>Value before the change.</p>
088     * @param previousValue value to be set
089     */
090
091    public void setPreviousValue(final SetCartScoreShippingRateInputValue previousValue);
092
093    /**
094     *  <p>Value before the change.</p>
095     * @param previousValue value to be set
096     */
097
098    public void setPreviousValue(final Object previousValue);
099
100    /**
101     *  <p>Value after the change.</p>
102     * @param nextValue value to be set
103     */
104
105    public void setNextValue(final SetCartClassificationShippingRateInputValue nextValue);
106
107    /**
108     *  <p>Value after the change.</p>
109     * @param nextValue value to be set
110     */
111
112    public void setNextValue(final SetCartScoreShippingRateInputValue nextValue);
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     * factory method
123     * @return instance of SetShippingRateInputChange
124     */
125    public static SetShippingRateInputChange of() {
126        return new SetShippingRateInputChangeImpl();
127    }
128
129    /**
130     * factory method to create a shallow copy SetShippingRateInputChange
131     * @param template instance to be copied
132     * @return copy instance
133     */
134    public static SetShippingRateInputChange of(final SetShippingRateInputChange template) {
135        SetShippingRateInputChangeImpl instance = new SetShippingRateInputChangeImpl();
136        instance.setChange(template.getChange());
137        instance.setPreviousValue(template.getPreviousValue());
138        instance.setNextValue(template.getNextValue());
139        return instance;
140    }
141
142    /**
143     * factory method to create a deep copy of SetShippingRateInputChange
144     * @param template instance to be copied
145     * @return copy instance
146     */
147    @Nullable
148    public static SetShippingRateInputChange deepCopy(@Nullable final SetShippingRateInputChange template) {
149        if (template == null) {
150            return null;
151        }
152        SetShippingRateInputChangeImpl instance = new SetShippingRateInputChangeImpl();
153        instance.setChange(template.getChange());
154        instance.setPreviousValue(template.getPreviousValue());
155        instance.setNextValue(template.getNextValue());
156        return instance;
157    }
158
159    /**
160     * builder factory method for SetShippingRateInputChange
161     * @return builder
162     */
163    public static SetShippingRateInputChangeBuilder builder() {
164        return SetShippingRateInputChangeBuilder.of();
165    }
166
167    /**
168     * create builder for SetShippingRateInputChange instance
169     * @param template instance with prefilled values for the builder
170     * @return builder
171     */
172    public static SetShippingRateInputChangeBuilder builder(final SetShippingRateInputChange template) {
173        return SetShippingRateInputChangeBuilder.of(template);
174    }
175
176    /**
177     * accessor map function
178     * @param <T> mapped type
179     * @param helper function to map the object
180     * @return mapped value
181     */
182    default <T> T withSetShippingRateInputChange(Function<SetShippingRateInputChange, T> helper) {
183        return helper.apply(this);
184    }
185
186    /**
187     * gives a TypeReference for usage with Jackson DataBind
188     * @return TypeReference
189     */
190    public static com.fasterxml.jackson.core.type.TypeReference<SetShippingRateInputChange> typeReference() {
191        return new com.fasterxml.jackson.core.type.TypeReference<SetShippingRateInputChange>() {
192            @Override
193            public String toString() {
194                return "TypeReference<SetShippingRateInputChange>";
195            }
196        };
197    }
198}