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