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.Price;
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 Add Price 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 *     AddPriceChange addPriceChange = AddPriceChange.builder()
026 *             .change("{change}")
027 *             .nextValue(nextValueBuilder -> nextValueBuilder)
028 *             .catalogData("{catalogData}")
029 *             .priceId("{priceId}")
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 = AddPriceChangeImpl.class)
036public interface AddPriceChange extends Change {
037
038    /**
039     * discriminator value for AddPriceChange
040     */
041    String ADD_PRICE_CHANGE = "AddPriceChange";
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 after the change.</p>
061     * @return nextValue
062     */
063    @NotNull
064    @Valid
065    @JsonProperty("nextValue")
066    public Price getNextValue();
067
068    /**
069     *  <ul>
070     *   <li><code>staged</code>, if the staged ProductCatalogData was updated.</li>
071     *   <li><code>current</code>, if the current ProductCatalogData was updated.</li>
072     *  </ul>
073     * @return catalogData
074     */
075    @NotNull
076    @JsonProperty("catalogData")
077    public String getCatalogData();
078
079    /**
080     *  <p><code>id</code> of the Embedded Price.</p>
081     * @return priceId
082     */
083    @NotNull
084    @JsonProperty("priceId")
085    public String getPriceId();
086
087    /**
088     * set change
089     * @param change value to be set
090     */
091
092    public void setChange(final String change);
093
094    /**
095     *  <p>Value after the change.</p>
096     * @param nextValue value to be set
097     */
098
099    public void setNextValue(final Price nextValue);
100
101    /**
102     *  <ul>
103     *   <li><code>staged</code>, if the staged ProductCatalogData was updated.</li>
104     *   <li><code>current</code>, if the current ProductCatalogData was updated.</li>
105     *  </ul>
106     * @param catalogData value to be set
107     */
108
109    public void setCatalogData(final String catalogData);
110
111    /**
112     *  <p><code>id</code> of the Embedded Price.</p>
113     * @param priceId value to be set
114     */
115
116    public void setPriceId(final String priceId);
117
118    /**
119     * factory method
120     * @return instance of AddPriceChange
121     */
122    public static AddPriceChange of() {
123        return new AddPriceChangeImpl();
124    }
125
126    /**
127     * factory method to create a shallow copy AddPriceChange
128     * @param template instance to be copied
129     * @return copy instance
130     */
131    public static AddPriceChange of(final AddPriceChange template) {
132        AddPriceChangeImpl instance = new AddPriceChangeImpl();
133        instance.setChange(template.getChange());
134        instance.setNextValue(template.getNextValue());
135        instance.setCatalogData(template.getCatalogData());
136        instance.setPriceId(template.getPriceId());
137        return instance;
138    }
139
140    /**
141     * factory method to create a deep copy of AddPriceChange
142     * @param template instance to be copied
143     * @return copy instance
144     */
145    @Nullable
146    public static AddPriceChange deepCopy(@Nullable final AddPriceChange template) {
147        if (template == null) {
148            return null;
149        }
150        AddPriceChangeImpl instance = new AddPriceChangeImpl();
151        instance.setChange(template.getChange());
152        instance.setNextValue(com.commercetools.history.models.common.Price.deepCopy(template.getNextValue()));
153        instance.setCatalogData(template.getCatalogData());
154        instance.setPriceId(template.getPriceId());
155        return instance;
156    }
157
158    /**
159     * builder factory method for AddPriceChange
160     * @return builder
161     */
162    public static AddPriceChangeBuilder builder() {
163        return AddPriceChangeBuilder.of();
164    }
165
166    /**
167     * create builder for AddPriceChange instance
168     * @param template instance with prefilled values for the builder
169     * @return builder
170     */
171    public static AddPriceChangeBuilder builder(final AddPriceChange template) {
172        return AddPriceChangeBuilder.of(template);
173    }
174
175    /**
176     * accessor map function
177     * @param <T> mapped type
178     * @param helper function to map the object
179     * @return mapped value
180     */
181    default <T> T withAddPriceChange(Function<AddPriceChange, T> helper) {
182        return helper.apply(this);
183    }
184
185    /**
186     * gives a TypeReference for usage with Jackson DataBind
187     * @return TypeReference
188     */
189    public static com.fasterxml.jackson.core.type.TypeReference<AddPriceChange> typeReference() {
190        return new com.fasterxml.jackson.core.type.TypeReference<AddPriceChange>() {
191            @Override
192            public String toString() {
193                return "TypeReference<AddPriceChange>";
194            }
195        };
196    }
197}