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.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.commercetools.history.models.common.LocalizedString;
013import com.fasterxml.jackson.annotation.*;
014import com.fasterxml.jackson.databind.annotation.*;
015
016import io.vrap.rmf.base.client.utils.Generated;
017
018/**
019 * ProductLabel
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     ProductLabel productLabel = ProductLabel.builder()
026 *             .slug(slugBuilder -> slugBuilder)
027 *             .name(nameBuilder -> nameBuilder)
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 = ProductLabelImpl.class)
034public interface ProductLabel extends Label {
035
036    /**
037     * discriminator value for ProductLabel
038     */
039    String PRODUCT_LABEL = "ProductLabel";
040
041    /**
042     *
043     * @return type
044     */
045    @NotNull
046    @JsonProperty("type")
047    public String getType();
048
049    /**
050     *  <p>User-defined identifier used in a deep-link URL for the Product.</p>
051     * @return slug
052     */
053    @NotNull
054    @Valid
055    @JsonProperty("slug")
056    public LocalizedString getSlug();
057
058    /**
059     *  <p>Name of the Product.</p>
060     * @return name
061     */
062    @NotNull
063    @Valid
064    @JsonProperty("name")
065    public LocalizedString getName();
066
067    /**
068     *  <p>User-defined identifier used in a deep-link URL for the Product.</p>
069     * @param slug value to be set
070     */
071
072    public void setSlug(final LocalizedString slug);
073
074    /**
075     *  <p>Name of the Product.</p>
076     * @param name value to be set
077     */
078
079    public void setName(final LocalizedString name);
080
081    /**
082     * factory method
083     * @return instance of ProductLabel
084     */
085    public static ProductLabel of() {
086        return new ProductLabelImpl();
087    }
088
089    /**
090     * factory method to create a shallow copy ProductLabel
091     * @param template instance to be copied
092     * @return copy instance
093     */
094    public static ProductLabel of(final ProductLabel template) {
095        ProductLabelImpl instance = new ProductLabelImpl();
096        instance.setSlug(template.getSlug());
097        instance.setName(template.getName());
098        return instance;
099    }
100
101    /**
102     * factory method to create a deep copy of ProductLabel
103     * @param template instance to be copied
104     * @return copy instance
105     */
106    @Nullable
107    public static ProductLabel deepCopy(@Nullable final ProductLabel template) {
108        if (template == null) {
109            return null;
110        }
111        ProductLabelImpl instance = new ProductLabelImpl();
112        instance.setSlug(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getSlug()));
113        instance.setName(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getName()));
114        return instance;
115    }
116
117    /**
118     * builder factory method for ProductLabel
119     * @return builder
120     */
121    public static ProductLabelBuilder builder() {
122        return ProductLabelBuilder.of();
123    }
124
125    /**
126     * create builder for ProductLabel instance
127     * @param template instance with prefilled values for the builder
128     * @return builder
129     */
130    public static ProductLabelBuilder builder(final ProductLabel template) {
131        return ProductLabelBuilder.of(template);
132    }
133
134    /**
135     * accessor map function
136     * @param <T> mapped type
137     * @param helper function to map the object
138     * @return mapped value
139     */
140    default <T> T withProductLabel(Function<ProductLabel, T> helper) {
141        return helper.apply(this);
142    }
143
144    /**
145     * gives a TypeReference for usage with Jackson DataBind
146     * @return TypeReference
147     */
148    public static com.fasterxml.jackson.core.type.TypeReference<ProductLabel> typeReference() {
149        return new com.fasterxml.jackson.core.type.TypeReference<ProductLabel>() {
150            @Override
151            public String toString() {
152                return "TypeReference<ProductLabel>";
153            }
154        };
155    }
156}