001
002package com.commercetools.api.models.message;
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.api.models.state.StateReference;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 *  <p>Generated after a successful Transition State 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 *     PaymentStatusStateTransitionMessagePayload paymentStatusStateTransitionMessagePayload = PaymentStatusStateTransitionMessagePayload.builder()
026 *             .state(stateBuilder -> stateBuilder)
027 *             .force(true)
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 = PaymentStatusStateTransitionMessagePayloadImpl.class)
034public interface PaymentStatusStateTransitionMessagePayload extends MessagePayload {
035
036    /**
037     * discriminator value for PaymentStatusStateTransitionMessagePayload
038     */
039    String PAYMENT_STATUS_STATE_TRANSITION = "PaymentStatusStateTransition";
040
041    /**
042     *  <p>State of the Payment after the Transition State update action.</p>
043     * @return state
044     */
045    @NotNull
046    @Valid
047    @JsonProperty("state")
048    public StateReference getState();
049
050    /**
051     *  <p>Whether State transition validations were turned off during the Change Transaction State update action.</p>
052     * @return force
053     */
054    @NotNull
055    @JsonProperty("force")
056    public Boolean getForce();
057
058    /**
059     *  <p>State of the Payment after the Transition State update action.</p>
060     * @param state value to be set
061     */
062
063    public void setState(final StateReference state);
064
065    /**
066     *  <p>Whether State transition validations were turned off during the Change Transaction State update action.</p>
067     * @param force value to be set
068     */
069
070    public void setForce(final Boolean force);
071
072    /**
073     * factory method
074     * @return instance of PaymentStatusStateTransitionMessagePayload
075     */
076    public static PaymentStatusStateTransitionMessagePayload of() {
077        return new PaymentStatusStateTransitionMessagePayloadImpl();
078    }
079
080    /**
081     * factory method to create a shallow copy PaymentStatusStateTransitionMessagePayload
082     * @param template instance to be copied
083     * @return copy instance
084     */
085    public static PaymentStatusStateTransitionMessagePayload of(
086            final PaymentStatusStateTransitionMessagePayload template) {
087        PaymentStatusStateTransitionMessagePayloadImpl instance = new PaymentStatusStateTransitionMessagePayloadImpl();
088        instance.setState(template.getState());
089        instance.setForce(template.getForce());
090        return instance;
091    }
092
093    /**
094     * factory method to create a deep copy of PaymentStatusStateTransitionMessagePayload
095     * @param template instance to be copied
096     * @return copy instance
097     */
098    @Nullable
099    public static PaymentStatusStateTransitionMessagePayload deepCopy(
100            @Nullable final PaymentStatusStateTransitionMessagePayload template) {
101        if (template == null) {
102            return null;
103        }
104        PaymentStatusStateTransitionMessagePayloadImpl instance = new PaymentStatusStateTransitionMessagePayloadImpl();
105        instance.setState(com.commercetools.api.models.state.StateReference.deepCopy(template.getState()));
106        instance.setForce(template.getForce());
107        return instance;
108    }
109
110    /**
111     * builder factory method for PaymentStatusStateTransitionMessagePayload
112     * @return builder
113     */
114    public static PaymentStatusStateTransitionMessagePayloadBuilder builder() {
115        return PaymentStatusStateTransitionMessagePayloadBuilder.of();
116    }
117
118    /**
119     * create builder for PaymentStatusStateTransitionMessagePayload instance
120     * @param template instance with prefilled values for the builder
121     * @return builder
122     */
123    public static PaymentStatusStateTransitionMessagePayloadBuilder builder(
124            final PaymentStatusStateTransitionMessagePayload template) {
125        return PaymentStatusStateTransitionMessagePayloadBuilder.of(template);
126    }
127
128    /**
129     * accessor map function
130     * @param <T> mapped type
131     * @param helper function to map the object
132     * @return mapped value
133     */
134    default <T> T withPaymentStatusStateTransitionMessagePayload(
135            Function<PaymentStatusStateTransitionMessagePayload, T> helper) {
136        return helper.apply(this);
137    }
138
139    /**
140     * gives a TypeReference for usage with Jackson DataBind
141     * @return TypeReference
142     */
143    public static com.fasterxml.jackson.core.type.TypeReference<PaymentStatusStateTransitionMessagePayload> typeReference() {
144        return new com.fasterxml.jackson.core.type.TypeReference<PaymentStatusStateTransitionMessagePayload>() {
145            @Override
146            public String toString() {
147                return "TypeReference<PaymentStatusStateTransitionMessagePayload>";
148            }
149        };
150    }
151}