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