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.ReturnInfo;
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>Add ReturnInfo on Orders.</li>
022 *   <li>Add ReturnInfo 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 *     AddReturnInfoChange addReturnInfoChange = AddReturnInfoChange.builder()
030 *             .change("{change}")
031 *             .nextValue(nextValueBuilder -> nextValueBuilder)
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 = AddReturnInfoChangeImpl.class)
038public interface AddReturnInfoChange extends Change {
039
040    /**
041     * discriminator value for AddReturnInfoChange
042     */
043    String ADD_RETURN_INFO_CHANGE = "AddReturnInfoChange";
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 after the change.</p>
063     * @return nextValue
064     */
065    @NotNull
066    @Valid
067    @JsonProperty("nextValue")
068    public ReturnInfo getNextValue();
069
070    /**
071     * set change
072     * @param change value to be set
073     */
074
075    public void setChange(final String change);
076
077    /**
078     *  <p>Value after the change.</p>
079     * @param nextValue value to be set
080     */
081
082    public void setNextValue(final ReturnInfo nextValue);
083
084    /**
085     * factory method
086     * @return instance of AddReturnInfoChange
087     */
088    public static AddReturnInfoChange of() {
089        return new AddReturnInfoChangeImpl();
090    }
091
092    /**
093     * factory method to create a shallow copy AddReturnInfoChange
094     * @param template instance to be copied
095     * @return copy instance
096     */
097    public static AddReturnInfoChange of(final AddReturnInfoChange template) {
098        AddReturnInfoChangeImpl instance = new AddReturnInfoChangeImpl();
099        instance.setChange(template.getChange());
100        instance.setNextValue(template.getNextValue());
101        return instance;
102    }
103
104    /**
105     * factory method to create a deep copy of AddReturnInfoChange
106     * @param template instance to be copied
107     * @return copy instance
108     */
109    @Nullable
110    public static AddReturnInfoChange deepCopy(@Nullable final AddReturnInfoChange template) {
111        if (template == null) {
112            return null;
113        }
114        AddReturnInfoChangeImpl instance = new AddReturnInfoChangeImpl();
115        instance.setChange(template.getChange());
116        instance.setNextValue(com.commercetools.history.models.common.ReturnInfo.deepCopy(template.getNextValue()));
117        return instance;
118    }
119
120    /**
121     * builder factory method for AddReturnInfoChange
122     * @return builder
123     */
124    public static AddReturnInfoChangeBuilder builder() {
125        return AddReturnInfoChangeBuilder.of();
126    }
127
128    /**
129     * create builder for AddReturnInfoChange instance
130     * @param template instance with prefilled values for the builder
131     * @return builder
132     */
133    public static AddReturnInfoChangeBuilder builder(final AddReturnInfoChange template) {
134        return AddReturnInfoChangeBuilder.of(template);
135    }
136
137    /**
138     * accessor map function
139     * @param <T> mapped type
140     * @param helper function to map the object
141     * @return mapped value
142     */
143    default <T> T withAddReturnInfoChange(Function<AddReturnInfoChange, T> helper) {
144        return helper.apply(this);
145    }
146
147    /**
148     * gives a TypeReference for usage with Jackson DataBind
149     * @return TypeReference
150     */
151    public static com.fasterxml.jackson.core.type.TypeReference<AddReturnInfoChange> typeReference() {
152        return new com.fasterxml.jackson.core.type.TypeReference<AddReturnInfoChange>() {
153            @Override
154            public String toString() {
155                return "TypeReference<AddReturnInfoChange>";
156            }
157        };
158    }
159}