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 TransactionTimestamp 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 *     ChangeTransactionTimestampChange changeTransactionTimestampChange = ChangeTransactionTimestampChange.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 = ChangeTransactionTimestampChangeImpl.class)
036public interface ChangeTransactionTimestampChange extends Change {
037
038    /**
039     * discriminator value for ChangeTransactionTimestampChange
040     */
041    String CHANGE_TRANSACTION_TIMESTAMP_CHANGE = "ChangeTransactionTimestampChange";
042
043    /**
044     *
045     * @return change
046     */
047    @NotNull
048    @JsonProperty("change")
049    public String getChange();
050
051    /**
052     *
053     * @return type
054     */
055    @NotNull
056    @JsonProperty("type")
057    public String getType();
058
059    /**
060     *  <p>Value before the change.</p>
061     * @return previousValue
062     */
063    @NotNull
064    @JsonProperty("previousValue")
065    public String getPreviousValue();
066
067    /**
068     *  <p>Value after 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 before the change.</p>
093     * @param previousValue value to be set
094     */
095
096    public void setPreviousValue(final String previousValue);
097
098    /**
099     *  <p>Value after 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 ChangeTransactionTimestampChange
115     */
116    public static ChangeTransactionTimestampChange of() {
117        return new ChangeTransactionTimestampChangeImpl();
118    }
119
120    /**
121     * factory method to create a shallow copy ChangeTransactionTimestampChange
122     * @param template instance to be copied
123     * @return copy instance
124     */
125    public static ChangeTransactionTimestampChange of(final ChangeTransactionTimestampChange template) {
126        ChangeTransactionTimestampChangeImpl instance = new ChangeTransactionTimestampChangeImpl();
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 ChangeTransactionTimestampChange
136     * @param template instance to be copied
137     * @return copy instance
138     */
139    @Nullable
140    public static ChangeTransactionTimestampChange deepCopy(@Nullable final ChangeTransactionTimestampChange template) {
141        if (template == null) {
142            return null;
143        }
144        ChangeTransactionTimestampChangeImpl instance = new ChangeTransactionTimestampChangeImpl();
145        instance.setChange(template.getChange());
146        instance.setPreviousValue(template.getPreviousValue());
147        instance.setNextValue(template.getNextValue());
148        instance.setTransaction(
149            com.commercetools.history.models.change_value.TransactionChangeValue.deepCopy(template.getTransaction()));
150        return instance;
151    }
152
153    /**
154     * builder factory method for ChangeTransactionTimestampChange
155     * @return builder
156     */
157    public static ChangeTransactionTimestampChangeBuilder builder() {
158        return ChangeTransactionTimestampChangeBuilder.of();
159    }
160
161    /**
162     * create builder for ChangeTransactionTimestampChange instance
163     * @param template instance with prefilled values for the builder
164     * @return builder
165     */
166    public static ChangeTransactionTimestampChangeBuilder builder(final ChangeTransactionTimestampChange template) {
167        return ChangeTransactionTimestampChangeBuilder.of(template);
168    }
169
170    /**
171     * accessor map function
172     * @param <T> mapped type
173     * @param helper function to map the object
174     * @return mapped value
175     */
176    default <T> T withChangeTransactionTimestampChange(Function<ChangeTransactionTimestampChange, T> helper) {
177        return helper.apply(this);
178    }
179
180    /**
181     * gives a TypeReference for usage with Jackson DataBind
182     * @return TypeReference
183     */
184    public static com.fasterxml.jackson.core.type.TypeReference<ChangeTransactionTimestampChange> typeReference() {
185        return new com.fasterxml.jackson.core.type.TypeReference<ChangeTransactionTimestampChange>() {
186            @Override
187            public String toString() {
188                return "TypeReference<ChangeTransactionTimestampChange>";
189            }
190        };
191    }
192}