001
002package com.commercetools.history.models.change_value;
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.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 * TransactionChangeValue
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     TransactionChangeValue transactionChangeValue = TransactionChangeValue.builder()
024 *             .id("{id}")
025 *             .interactionId("{interactionId}")
026 *             .timestamp("{timestamp}")
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 = TransactionChangeValueImpl.class)
033public interface TransactionChangeValue {
034
035    /**
036     *  <p><code>id</code> of the Transaction.</p>
037     * @return id
038     */
039    @NotNull
040    @JsonProperty("id")
041    public String getId();
042
043    /**
044     *  <p>Identifier used by the interface that manages the Transaction (usually the PSP).</p>
045     * @return interactionId
046     */
047    @NotNull
048    @JsonProperty("interactionId")
049    public String getInteractionId();
050
051    /**
052     *  <p>Date and time (UTC) the Transaction took place.</p>
053     * @return timestamp
054     */
055    @NotNull
056    @JsonProperty("timestamp")
057    public String getTimestamp();
058
059    /**
060     *  <p><code>id</code> of the Transaction.</p>
061     * @param id value to be set
062     */
063
064    public void setId(final String id);
065
066    /**
067     *  <p>Identifier used by the interface that manages the Transaction (usually the PSP).</p>
068     * @param interactionId value to be set
069     */
070
071    public void setInteractionId(final String interactionId);
072
073    /**
074     *  <p>Date and time (UTC) the Transaction took place.</p>
075     * @param timestamp value to be set
076     */
077
078    public void setTimestamp(final String timestamp);
079
080    /**
081     * factory method
082     * @return instance of TransactionChangeValue
083     */
084    public static TransactionChangeValue of() {
085        return new TransactionChangeValueImpl();
086    }
087
088    /**
089     * factory method to create a shallow copy TransactionChangeValue
090     * @param template instance to be copied
091     * @return copy instance
092     */
093    public static TransactionChangeValue of(final TransactionChangeValue template) {
094        TransactionChangeValueImpl instance = new TransactionChangeValueImpl();
095        instance.setId(template.getId());
096        instance.setInteractionId(template.getInteractionId());
097        instance.setTimestamp(template.getTimestamp());
098        return instance;
099    }
100
101    /**
102     * factory method to create a deep copy of TransactionChangeValue
103     * @param template instance to be copied
104     * @return copy instance
105     */
106    @Nullable
107    public static TransactionChangeValue deepCopy(@Nullable final TransactionChangeValue template) {
108        if (template == null) {
109            return null;
110        }
111        TransactionChangeValueImpl instance = new TransactionChangeValueImpl();
112        instance.setId(template.getId());
113        instance.setInteractionId(template.getInteractionId());
114        instance.setTimestamp(template.getTimestamp());
115        return instance;
116    }
117
118    /**
119     * builder factory method for TransactionChangeValue
120     * @return builder
121     */
122    public static TransactionChangeValueBuilder builder() {
123        return TransactionChangeValueBuilder.of();
124    }
125
126    /**
127     * create builder for TransactionChangeValue instance
128     * @param template instance with prefilled values for the builder
129     * @return builder
130     */
131    public static TransactionChangeValueBuilder builder(final TransactionChangeValue template) {
132        return TransactionChangeValueBuilder.of(template);
133    }
134
135    /**
136     * accessor map function
137     * @param <T> mapped type
138     * @param helper function to map the object
139     * @return mapped value
140     */
141    default <T> T withTransactionChangeValue(Function<TransactionChangeValue, T> helper) {
142        return helper.apply(this);
143    }
144
145    /**
146     * gives a TypeReference for usage with Jackson DataBind
147     * @return TypeReference
148     */
149    public static com.fasterxml.jackson.core.type.TypeReference<TransactionChangeValue> typeReference() {
150        return new com.fasterxml.jackson.core.type.TypeReference<TransactionChangeValue>() {
151            @Override
152            public String toString() {
153                return "TypeReference<TransactionChangeValue>";
154            }
155        };
156    }
157}