001
002package com.commercetools.history.models.label;
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.Money;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * PaymentLabel
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     PaymentLabel paymentLabel = PaymentLabel.builder()
026 *             .key("{key}")
027 *             .amountPlanned(amountPlannedBuilder -> amountPlannedBuilder)
028 *             .build()
029 * </code></pre>
030 * </div>
031 */
032@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
033@JsonDeserialize(as = PaymentLabelImpl.class)
034public interface PaymentLabel extends Label {
035
036    /**
037     * discriminator value for PaymentLabel
038     */
039    String PAYMENT_LABEL = "PaymentLabel";
040
041    /**
042     *
043     * @return type
044     */
045    @NotNull
046    @JsonProperty("type")
047    public String getType();
048
049    /**
050     *  <p>User-defined unique identifier of the Payment.</p>
051     * @return key
052     */
053    @NotNull
054    @JsonProperty("key")
055    public String getKey();
056
057    /**
058     *  <p>Money value the Payment intends to receive from the Customer.</p>
059     * @return amountPlanned
060     */
061    @NotNull
062    @Valid
063    @JsonProperty("amountPlanned")
064    public Money getAmountPlanned();
065
066    /**
067     *  <p>User-defined unique identifier of the Payment.</p>
068     * @param key value to be set
069     */
070
071    public void setKey(final String key);
072
073    /**
074     *  <p>Money value the Payment intends to receive from the Customer.</p>
075     * @param amountPlanned value to be set
076     */
077
078    public void setAmountPlanned(final Money amountPlanned);
079
080    /**
081     * factory method
082     * @return instance of PaymentLabel
083     */
084    public static PaymentLabel of() {
085        return new PaymentLabelImpl();
086    }
087
088    /**
089     * factory method to create a shallow copy PaymentLabel
090     * @param template instance to be copied
091     * @return copy instance
092     */
093    public static PaymentLabel of(final PaymentLabel template) {
094        PaymentLabelImpl instance = new PaymentLabelImpl();
095        instance.setKey(template.getKey());
096        instance.setAmountPlanned(template.getAmountPlanned());
097        return instance;
098    }
099
100    /**
101     * factory method to create a deep copy of PaymentLabel
102     * @param template instance to be copied
103     * @return copy instance
104     */
105    @Nullable
106    public static PaymentLabel deepCopy(@Nullable final PaymentLabel template) {
107        if (template == null) {
108            return null;
109        }
110        PaymentLabelImpl instance = new PaymentLabelImpl();
111        instance.setKey(template.getKey());
112        instance.setAmountPlanned(com.commercetools.history.models.common.Money.deepCopy(template.getAmountPlanned()));
113        return instance;
114    }
115
116    /**
117     * builder factory method for PaymentLabel
118     * @return builder
119     */
120    public static PaymentLabelBuilder builder() {
121        return PaymentLabelBuilder.of();
122    }
123
124    /**
125     * create builder for PaymentLabel instance
126     * @param template instance with prefilled values for the builder
127     * @return builder
128     */
129    public static PaymentLabelBuilder builder(final PaymentLabel template) {
130        return PaymentLabelBuilder.of(template);
131    }
132
133    /**
134     * accessor map function
135     * @param <T> mapped type
136     * @param helper function to map the object
137     * @return mapped value
138     */
139    default <T> T withPaymentLabel(Function<PaymentLabel, T> helper) {
140        return helper.apply(this);
141    }
142
143    /**
144     * gives a TypeReference for usage with Jackson DataBind
145     * @return TypeReference
146     */
147    public static com.fasterxml.jackson.core.type.TypeReference<PaymentLabel> typeReference() {
148        return new com.fasterxml.jackson.core.type.TypeReference<PaymentLabel>() {
149            @Override
150            public String toString() {
151                return "TypeReference<PaymentLabel>";
152            }
153        };
154    }
155}