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