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