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 * TextLineItemValue
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     TextLineItemValue textLineItemValue = TextLineItemValue.builder()
026 *             .id("{id}")
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 = TextLineItemValueImpl.class)
034public interface TextLineItemValue {
035
036    /**
037     *  <p><code>id</code> of the TextLineItem.</p>
038     * @return id
039     */
040    @NotNull
041    @JsonProperty("id")
042    public String getId();
043
044    /**
045     *  <p>Name of the TextLineItem.</p>
046     * @return name
047     */
048    @NotNull
049    @Valid
050    @JsonProperty("name")
051    public LocalizedString getName();
052
053    /**
054     *  <p><code>id</code> of the TextLineItem.</p>
055     * @param id value to be set
056     */
057
058    public void setId(final String id);
059
060    /**
061     *  <p>Name of the TextLineItem.</p>
062     * @param name value to be set
063     */
064
065    public void setName(final LocalizedString name);
066
067    /**
068     * factory method
069     * @return instance of TextLineItemValue
070     */
071    public static TextLineItemValue of() {
072        return new TextLineItemValueImpl();
073    }
074
075    /**
076     * factory method to create a shallow copy TextLineItemValue
077     * @param template instance to be copied
078     * @return copy instance
079     */
080    public static TextLineItemValue of(final TextLineItemValue template) {
081        TextLineItemValueImpl instance = new TextLineItemValueImpl();
082        instance.setId(template.getId());
083        instance.setName(template.getName());
084        return instance;
085    }
086
087    /**
088     * factory method to create a deep copy of TextLineItemValue
089     * @param template instance to be copied
090     * @return copy instance
091     */
092    @Nullable
093    public static TextLineItemValue deepCopy(@Nullable final TextLineItemValue template) {
094        if (template == null) {
095            return null;
096        }
097        TextLineItemValueImpl instance = new TextLineItemValueImpl();
098        instance.setId(template.getId());
099        instance.setName(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getName()));
100        return instance;
101    }
102
103    /**
104     * builder factory method for TextLineItemValue
105     * @return builder
106     */
107    public static TextLineItemValueBuilder builder() {
108        return TextLineItemValueBuilder.of();
109    }
110
111    /**
112     * create builder for TextLineItemValue instance
113     * @param template instance with prefilled values for the builder
114     * @return builder
115     */
116    public static TextLineItemValueBuilder builder(final TextLineItemValue template) {
117        return TextLineItemValueBuilder.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 withTextLineItemValue(Function<TextLineItemValue, 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<TextLineItemValue> typeReference() {
135        return new com.fasterxml.jackson.core.type.TypeReference<TextLineItemValue>() {
136            @Override
137            public String toString() {
138                return "TypeReference<TextLineItemValue>";
139            }
140        };
141    }
142}