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