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