001
002package com.commercetools.api.models.state;
003
004import java.util.*;
005
006import io.vrap.rmf.base.client.Builder;
007import io.vrap.rmf.base.client.utils.Generated;
008
009/**
010 * StateChangeTypeActionBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     StateChangeTypeAction stateChangeTypeAction = StateChangeTypeAction.builder()
016 *             .type(StateTypeEnum.ORDER_STATE)
017 *             .build()
018 * </code></pre>
019 * </div>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class StateChangeTypeActionBuilder implements Builder<StateChangeTypeAction> {
023
024    private com.commercetools.api.models.state.StateTypeEnum type;
025
026    /**
027     *  <p>Resource or object types the State shall be assigned to. Must not be empty.</p>
028     * @param type value to be set
029     * @return Builder
030     */
031
032    public StateChangeTypeActionBuilder type(final com.commercetools.api.models.state.StateTypeEnum type) {
033        this.type = type;
034        return this;
035    }
036
037    /**
038     *  <p>Resource or object types the State shall be assigned to. Must not be empty.</p>
039     * @return type
040     */
041
042    public com.commercetools.api.models.state.StateTypeEnum getType() {
043        return this.type;
044    }
045
046    /**
047     * builds StateChangeTypeAction with checking for non-null required values
048     * @return StateChangeTypeAction
049     */
050    public StateChangeTypeAction build() {
051        Objects.requireNonNull(type, StateChangeTypeAction.class + ": type is missing");
052        return new StateChangeTypeActionImpl(type);
053    }
054
055    /**
056     * builds StateChangeTypeAction without checking for non-null required values
057     * @return StateChangeTypeAction
058     */
059    public StateChangeTypeAction buildUnchecked() {
060        return new StateChangeTypeActionImpl(type);
061    }
062
063    /**
064     * factory method for an instance of StateChangeTypeActionBuilder
065     * @return builder
066     */
067    public static StateChangeTypeActionBuilder of() {
068        return new StateChangeTypeActionBuilder();
069    }
070
071    /**
072     * create builder for StateChangeTypeAction instance
073     * @param template instance with prefilled values for the builder
074     * @return builder
075     */
076    public static StateChangeTypeActionBuilder of(final StateChangeTypeAction template) {
077        StateChangeTypeActionBuilder builder = new StateChangeTypeActionBuilder();
078        builder.type = template.getType();
079        return builder;
080    }
081
082}