001
002package com.commercetools.importapi.models.common;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009
010import com.fasterxml.jackson.annotation.*;
011import com.fasterxml.jackson.databind.annotation.*;
012
013import io.vrap.rmf.base.client.utils.Generated;
014
015/**
016 *  <p>References a state by key.</p>
017 *
018 * <hr>
019 * Example to create an instance using the builder pattern
020 * <div class=code-example>
021 * <pre><code class='java'>
022 *     StateKeyReference stateKeyReference = StateKeyReference.builder()
023 *             .key("{key}")
024 *             .build()
025 * </code></pre>
026 * </div>
027 */
028@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
029@JsonDeserialize(as = StateKeyReferenceImpl.class)
030public interface StateKeyReference extends KeyReference {
031
032    /**
033     * discriminator value for StateKeyReference
034     */
035    String STATE = "state";
036
037    /**
038     * factory method
039     * @return instance of StateKeyReference
040     */
041    public static StateKeyReference of() {
042        return new StateKeyReferenceImpl();
043    }
044
045    /**
046     * factory method to create a shallow copy StateKeyReference
047     * @param template instance to be copied
048     * @return copy instance
049     */
050    public static StateKeyReference of(final StateKeyReference template) {
051        StateKeyReferenceImpl instance = new StateKeyReferenceImpl();
052        instance.setKey(template.getKey());
053        return instance;
054    }
055
056    /**
057     * factory method to create a deep copy of StateKeyReference
058     * @param template instance to be copied
059     * @return copy instance
060     */
061    @Nullable
062    public static StateKeyReference deepCopy(@Nullable final StateKeyReference template) {
063        if (template == null) {
064            return null;
065        }
066        StateKeyReferenceImpl instance = new StateKeyReferenceImpl();
067        instance.setKey(template.getKey());
068        return instance;
069    }
070
071    /**
072     * builder factory method for StateKeyReference
073     * @return builder
074     */
075    public static StateKeyReferenceBuilder builder() {
076        return StateKeyReferenceBuilder.of();
077    }
078
079    /**
080     * create builder for StateKeyReference instance
081     * @param template instance with prefilled values for the builder
082     * @return builder
083     */
084    public static StateKeyReferenceBuilder builder(final StateKeyReference template) {
085        return StateKeyReferenceBuilder.of(template);
086    }
087
088    /**
089     * accessor map function
090     * @param <T> mapped type
091     * @param helper function to map the object
092     * @return mapped value
093     */
094    default <T> T withStateKeyReference(Function<StateKeyReference, T> helper) {
095        return helper.apply(this);
096    }
097
098    /**
099     * gives a TypeReference for usage with Jackson DataBind
100     * @return TypeReference
101     */
102    public static com.fasterxml.jackson.core.type.TypeReference<StateKeyReference> typeReference() {
103        return new com.fasterxml.jackson.core.type.TypeReference<StateKeyReference>() {
104            @Override
105            public String toString() {
106                return "TypeReference<StateKeyReference>";
107            }
108        };
109    }
110}