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