001
002package com.commercetools.history.models.change_value;
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 * LocalizedEnumValue
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     LocalizedEnumValue localizedEnumValue = LocalizedEnumValue.builder()
026 *             .key("{key}")
027 *             .label(labelBuilder -> labelBuilder)
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 = LocalizedEnumValueImpl.class)
034public interface LocalizedEnumValue {
035
036    /**
037     *  <p>Key of the value used as a programmatic identifier.</p>
038     * @return key
039     */
040    @NotNull
041    @JsonProperty("key")
042    public String getKey();
043
044    /**
045     *  <p>Descriptive localized label of the value.</p>
046     * @return label
047     */
048    @NotNull
049    @Valid
050    @JsonProperty("label")
051    public LocalizedString getLabel();
052
053    /**
054     *  <p>Key of the value used as a programmatic identifier.</p>
055     * @param key value to be set
056     */
057
058    public void setKey(final String key);
059
060    /**
061     *  <p>Descriptive localized label of the value.</p>
062     * @param label value to be set
063     */
064
065    public void setLabel(final LocalizedString label);
066
067    /**
068     * factory method
069     * @return instance of LocalizedEnumValue
070     */
071    public static LocalizedEnumValue of() {
072        return new LocalizedEnumValueImpl();
073    }
074
075    /**
076     * factory method to create a shallow copy LocalizedEnumValue
077     * @param template instance to be copied
078     * @return copy instance
079     */
080    public static LocalizedEnumValue of(final LocalizedEnumValue template) {
081        LocalizedEnumValueImpl instance = new LocalizedEnumValueImpl();
082        instance.setKey(template.getKey());
083        instance.setLabel(template.getLabel());
084        return instance;
085    }
086
087    /**
088     * factory method to create a deep copy of LocalizedEnumValue
089     * @param template instance to be copied
090     * @return copy instance
091     */
092    @Nullable
093    public static LocalizedEnumValue deepCopy(@Nullable final LocalizedEnumValue template) {
094        if (template == null) {
095            return null;
096        }
097        LocalizedEnumValueImpl instance = new LocalizedEnumValueImpl();
098        instance.setKey(template.getKey());
099        instance.setLabel(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getLabel()));
100        return instance;
101    }
102
103    /**
104     * builder factory method for LocalizedEnumValue
105     * @return builder
106     */
107    public static LocalizedEnumValueBuilder builder() {
108        return LocalizedEnumValueBuilder.of();
109    }
110
111    /**
112     * create builder for LocalizedEnumValue instance
113     * @param template instance with prefilled values for the builder
114     * @return builder
115     */
116    public static LocalizedEnumValueBuilder builder(final LocalizedEnumValue template) {
117        return LocalizedEnumValueBuilder.of(template);
118    }
119
120    /**
121     * accessor map function
122     * @param <T> mapped type
123     * @param helper function to map the object
124     * @return mapped value
125     */
126    default <T> T withLocalizedEnumValue(Function<LocalizedEnumValue, T> helper) {
127        return helper.apply(this);
128    }
129
130    /**
131     * gives a TypeReference for usage with Jackson DataBind
132     * @return TypeReference
133     */
134    public static com.fasterxml.jackson.core.type.TypeReference<LocalizedEnumValue> typeReference() {
135        return new com.fasterxml.jackson.core.type.TypeReference<LocalizedEnumValue>() {
136            @Override
137            public String toString() {
138                return "TypeReference<LocalizedEnumValue>";
139            }
140        };
141    }
142}