001
002package com.commercetools.history.models.change;
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 *  <p>Change triggered by the Set AttributeDefinition InputTip update action.</p>
020 *
021 * <hr>
022 * Example to create an instance using the builder pattern
023 * <div class=code-example>
024 * <pre><code class='java'>
025 *     SetInputTipChange setInputTipChange = SetInputTipChange.builder()
026 *             .change("{change}")
027 *             .previousValue(previousValueBuilder -> previousValueBuilder)
028 *             .nextValue(nextValueBuilder -> nextValueBuilder)
029 *             .attributeName("{attributeName}")
030 *             .build()
031 * </code></pre>
032 * </div>
033 */
034@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
035@JsonDeserialize(as = SetInputTipChangeImpl.class)
036public interface SetInputTipChange extends Change {
037
038    /**
039     * discriminator value for SetInputTipChange
040     */
041    String SET_INPUT_TIP_CHANGE = "SetInputTipChange";
042
043    /**
044     *
045     * @return type
046     */
047    @NotNull
048    @JsonProperty("type")
049    public String getType();
050
051    /**
052     *
053     * @return change
054     */
055    @NotNull
056    @JsonProperty("change")
057    public String getChange();
058
059    /**
060     *  <p>Value before the change.</p>
061     * @return previousValue
062     */
063    @NotNull
064    @Valid
065    @JsonProperty("previousValue")
066    public LocalizedString getPreviousValue();
067
068    /**
069     *  <p>Value after the change.</p>
070     * @return nextValue
071     */
072    @NotNull
073    @Valid
074    @JsonProperty("nextValue")
075    public LocalizedString getNextValue();
076
077    /**
078     *  <p>Name of the updated AttributeDefinition.</p>
079     * @return attributeName
080     */
081    @NotNull
082    @JsonProperty("attributeName")
083    public String getAttributeName();
084
085    /**
086     * set change
087     * @param change value to be set
088     */
089
090    public void setChange(final String change);
091
092    /**
093     *  <p>Value before the change.</p>
094     * @param previousValue value to be set
095     */
096
097    public void setPreviousValue(final LocalizedString previousValue);
098
099    /**
100     *  <p>Value after the change.</p>
101     * @param nextValue value to be set
102     */
103
104    public void setNextValue(final LocalizedString nextValue);
105
106    /**
107     *  <p>Name of the updated AttributeDefinition.</p>
108     * @param attributeName value to be set
109     */
110
111    public void setAttributeName(final String attributeName);
112
113    /**
114     * factory method
115     * @return instance of SetInputTipChange
116     */
117    public static SetInputTipChange of() {
118        return new SetInputTipChangeImpl();
119    }
120
121    /**
122     * factory method to create a shallow copy SetInputTipChange
123     * @param template instance to be copied
124     * @return copy instance
125     */
126    public static SetInputTipChange of(final SetInputTipChange template) {
127        SetInputTipChangeImpl instance = new SetInputTipChangeImpl();
128        instance.setChange(template.getChange());
129        instance.setPreviousValue(template.getPreviousValue());
130        instance.setNextValue(template.getNextValue());
131        instance.setAttributeName(template.getAttributeName());
132        return instance;
133    }
134
135    /**
136     * factory method to create a deep copy of SetInputTipChange
137     * @param template instance to be copied
138     * @return copy instance
139     */
140    @Nullable
141    public static SetInputTipChange deepCopy(@Nullable final SetInputTipChange template) {
142        if (template == null) {
143            return null;
144        }
145        SetInputTipChangeImpl instance = new SetInputTipChangeImpl();
146        instance.setChange(template.getChange());
147        instance.setPreviousValue(
148            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getPreviousValue()));
149        instance.setNextValue(
150            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getNextValue()));
151        instance.setAttributeName(template.getAttributeName());
152        return instance;
153    }
154
155    /**
156     * builder factory method for SetInputTipChange
157     * @return builder
158     */
159    public static SetInputTipChangeBuilder builder() {
160        return SetInputTipChangeBuilder.of();
161    }
162
163    /**
164     * create builder for SetInputTipChange instance
165     * @param template instance with prefilled values for the builder
166     * @return builder
167     */
168    public static SetInputTipChangeBuilder builder(final SetInputTipChange template) {
169        return SetInputTipChangeBuilder.of(template);
170    }
171
172    /**
173     * accessor map function
174     * @param <T> mapped type
175     * @param helper function to map the object
176     * @return mapped value
177     */
178    default <T> T withSetInputTipChange(Function<SetInputTipChange, T> helper) {
179        return helper.apply(this);
180    }
181
182    /**
183     * gives a TypeReference for usage with Jackson DataBind
184     * @return TypeReference
185     */
186    public static com.fasterxml.jackson.core.type.TypeReference<SetInputTipChange> typeReference() {
187        return new com.fasterxml.jackson.core.type.TypeReference<SetInputTipChange>() {
188            @Override
189            public String toString() {
190                return "TypeReference<SetInputTipChange>";
191            }
192        };
193    }
194}