001
002package com.commercetools.api.models.state;
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 * StateChangeInitialAction
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     StateChangeInitialAction stateChangeInitialAction = StateChangeInitialAction.builder()
024 *             .initial(true)
025 *             .build()
026 * </code></pre>
027 * </div>
028 */
029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
030@JsonDeserialize(as = StateChangeInitialActionImpl.class)
031public interface StateChangeInitialAction extends StateUpdateAction {
032
033    /**
034     * discriminator value for StateChangeInitialAction
035     */
036    String CHANGE_INITIAL = "changeInitial";
037
038    /**
039     *  <p>Set to <code>true</code> for defining the State as initial State in a state machine and making it the first step in a workflow.</p>
040     * @return initial
041     */
042    @NotNull
043    @JsonProperty("initial")
044    public Boolean getInitial();
045
046    /**
047     *  <p>Set to <code>true</code> for defining the State as initial State in a state machine and making it the first step in a workflow.</p>
048     * @param initial value to be set
049     */
050
051    public void setInitial(final Boolean initial);
052
053    /**
054     * factory method
055     * @return instance of StateChangeInitialAction
056     */
057    public static StateChangeInitialAction of() {
058        return new StateChangeInitialActionImpl();
059    }
060
061    /**
062     * factory method to create a shallow copy StateChangeInitialAction
063     * @param template instance to be copied
064     * @return copy instance
065     */
066    public static StateChangeInitialAction of(final StateChangeInitialAction template) {
067        StateChangeInitialActionImpl instance = new StateChangeInitialActionImpl();
068        instance.setInitial(template.getInitial());
069        return instance;
070    }
071
072    /**
073     * factory method to create a deep copy of StateChangeInitialAction
074     * @param template instance to be copied
075     * @return copy instance
076     */
077    @Nullable
078    public static StateChangeInitialAction deepCopy(@Nullable final StateChangeInitialAction template) {
079        if (template == null) {
080            return null;
081        }
082        StateChangeInitialActionImpl instance = new StateChangeInitialActionImpl();
083        instance.setInitial(template.getInitial());
084        return instance;
085    }
086
087    /**
088     * builder factory method for StateChangeInitialAction
089     * @return builder
090     */
091    public static StateChangeInitialActionBuilder builder() {
092        return StateChangeInitialActionBuilder.of();
093    }
094
095    /**
096     * create builder for StateChangeInitialAction instance
097     * @param template instance with prefilled values for the builder
098     * @return builder
099     */
100    public static StateChangeInitialActionBuilder builder(final StateChangeInitialAction template) {
101        return StateChangeInitialActionBuilder.of(template);
102    }
103
104    /**
105     * accessor map function
106     * @param <T> mapped type
107     * @param helper function to map the object
108     * @return mapped value
109     */
110    default <T> T withStateChangeInitialAction(Function<StateChangeInitialAction, T> helper) {
111        return helper.apply(this);
112    }
113
114    /**
115     * gives a TypeReference for usage with Jackson DataBind
116     * @return TypeReference
117     */
118    public static com.fasterxml.jackson.core.type.TypeReference<StateChangeInitialAction> typeReference() {
119        return new com.fasterxml.jackson.core.type.TypeReference<StateChangeInitialAction>() {
120            @Override
121            public String toString() {
122                return "TypeReference<StateChangeInitialAction>";
123            }
124        };
125    }
126}