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 automatically due to a user-initiated change.</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 *     SetLineItemProductSlugChange setLineItemProductSlugChange = SetLineItemProductSlugChange.builder()
026 *             .change("{change}")
027 *             .previousValue(previousValueBuilder -> previousValueBuilder)
028 *             .nextValue(nextValueBuilder -> nextValueBuilder)
029 *             .lineItem(lineItemBuilder -> lineItemBuilder)
030 *             .variant("{variant}")
031 *             .build()
032 * </code></pre>
033 * </div>
034 */
035@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
036@JsonDeserialize(as = SetLineItemProductSlugChangeImpl.class)
037public interface SetLineItemProductSlugChange extends Change {
038
039    /**
040     * discriminator value for SetLineItemProductSlugChange
041     */
042    String SET_LINE_ITEM_PRODUCT_SLUG_CHANGE = "SetLineItemProductSlugChange";
043
044    /**
045     *
046     * @return type
047     */
048    @NotNull
049    @JsonProperty("type")
050    public String getType();
051
052    /**
053     *
054     * @return change
055     */
056    @NotNull
057    @JsonProperty("change")
058    public String getChange();
059
060    /**
061     *  <p>Value before the change.</p>
062     * @return previousValue
063     */
064    @NotNull
065    @Valid
066    @JsonProperty("previousValue")
067    public LocalizedString getPreviousValue();
068
069    /**
070     *  <p>Value after the change.</p>
071     * @return nextValue
072     */
073    @NotNull
074    @Valid
075    @JsonProperty("nextValue")
076    public LocalizedString getNextValue();
077
078    /**
079     *  <p>Name of the Product the updated Line Item is based on.</p>
080     * @return lineItem
081     */
082    @NotNull
083    @Valid
084    @JsonProperty("lineItem")
085    public LocalizedString getLineItem();
086
087    /**
088     *  <p><code>sku</code> or <code>key</code> of the updated ProductVariant.</p>
089     * @return variant
090     */
091    @NotNull
092    @JsonProperty("variant")
093    public String getVariant();
094
095    /**
096     * set change
097     * @param change value to be set
098     */
099
100    public void setChange(final String change);
101
102    /**
103     *  <p>Value before the change.</p>
104     * @param previousValue value to be set
105     */
106
107    public void setPreviousValue(final LocalizedString previousValue);
108
109    /**
110     *  <p>Value after the change.</p>
111     * @param nextValue value to be set
112     */
113
114    public void setNextValue(final LocalizedString nextValue);
115
116    /**
117     *  <p>Name of the Product the updated Line Item is based on.</p>
118     * @param lineItem value to be set
119     */
120
121    public void setLineItem(final LocalizedString lineItem);
122
123    /**
124     *  <p><code>sku</code> or <code>key</code> of the updated ProductVariant.</p>
125     * @param variant value to be set
126     */
127
128    public void setVariant(final String variant);
129
130    /**
131     * factory method
132     * @return instance of SetLineItemProductSlugChange
133     */
134    public static SetLineItemProductSlugChange of() {
135        return new SetLineItemProductSlugChangeImpl();
136    }
137
138    /**
139     * factory method to create a shallow copy SetLineItemProductSlugChange
140     * @param template instance to be copied
141     * @return copy instance
142     */
143    public static SetLineItemProductSlugChange of(final SetLineItemProductSlugChange template) {
144        SetLineItemProductSlugChangeImpl instance = new SetLineItemProductSlugChangeImpl();
145        instance.setChange(template.getChange());
146        instance.setPreviousValue(template.getPreviousValue());
147        instance.setNextValue(template.getNextValue());
148        instance.setLineItem(template.getLineItem());
149        instance.setVariant(template.getVariant());
150        return instance;
151    }
152
153    /**
154     * factory method to create a deep copy of SetLineItemProductSlugChange
155     * @param template instance to be copied
156     * @return copy instance
157     */
158    @Nullable
159    public static SetLineItemProductSlugChange deepCopy(@Nullable final SetLineItemProductSlugChange template) {
160        if (template == null) {
161            return null;
162        }
163        SetLineItemProductSlugChangeImpl instance = new SetLineItemProductSlugChangeImpl();
164        instance.setChange(template.getChange());
165        instance.setPreviousValue(
166            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getPreviousValue()));
167        instance.setNextValue(
168            com.commercetools.history.models.common.LocalizedString.deepCopy(template.getNextValue()));
169        instance.setLineItem(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getLineItem()));
170        instance.setVariant(template.getVariant());
171        return instance;
172    }
173
174    /**
175     * builder factory method for SetLineItemProductSlugChange
176     * @return builder
177     */
178    public static SetLineItemProductSlugChangeBuilder builder() {
179        return SetLineItemProductSlugChangeBuilder.of();
180    }
181
182    /**
183     * create builder for SetLineItemProductSlugChange instance
184     * @param template instance with prefilled values for the builder
185     * @return builder
186     */
187    public static SetLineItemProductSlugChangeBuilder builder(final SetLineItemProductSlugChange template) {
188        return SetLineItemProductSlugChangeBuilder.of(template);
189    }
190
191    /**
192     * accessor map function
193     * @param <T> mapped type
194     * @param helper function to map the object
195     * @return mapped value
196     */
197    default <T> T withSetLineItemProductSlugChange(Function<SetLineItemProductSlugChange, T> helper) {
198        return helper.apply(this);
199    }
200
201    /**
202     * gives a TypeReference for usage with Jackson DataBind
203     * @return TypeReference
204     */
205    public static com.fasterxml.jackson.core.type.TypeReference<SetLineItemProductSlugChange> typeReference() {
206        return new com.fasterxml.jackson.core.type.TypeReference<SetLineItemProductSlugChange>() {
207            @Override
208            public String toString() {
209                return "TypeReference<SetLineItemProductSlugChange>";
210            }
211        };
212    }
213}