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