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 updated.</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 * SetPropertyChange setPropertyChange = SetPropertyChange.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 = SetPropertyChangeImpl.class) 032public interface SetPropertyChange extends Change { 033 034 /** 035 * discriminator value for SetPropertyChange 036 */ 037 String SET_PROPERTY_CHANGE = "SetPropertyChange"; 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>Value after the change.</p> 065 * @return nextValue 066 */ 067 @NotNull 068 @JsonProperty("nextValue") 069 public Object getNextValue(); 070 071 /** 072 * <p>Path to the property that was updated.</p> 073 * @return path 074 */ 075 @NotNull 076 @JsonProperty("path") 077 public String getPath(); 078 079 /** 080 * set change 081 * @param change value to be set 082 */ 083 084 public void setChange(final String change); 085 086 /** 087 * <p>Value before the change.</p> 088 * @param previousValue value to be set 089 */ 090 091 public void setPreviousValue(final Object previousValue); 092 093 /** 094 * <p>Value after the change.</p> 095 * @param nextValue value to be set 096 */ 097 098 public void setNextValue(final Object nextValue); 099 100 /** 101 * <p>Path to the property that was updated.</p> 102 * @param path value to be set 103 */ 104 105 public void setPath(final String path); 106 107 /** 108 * factory method 109 * @return instance of SetPropertyChange 110 */ 111 public static SetPropertyChange of() { 112 return new SetPropertyChangeImpl(); 113 } 114 115 /** 116 * factory method to create a shallow copy SetPropertyChange 117 * @param template instance to be copied 118 * @return copy instance 119 */ 120 public static SetPropertyChange of(final SetPropertyChange template) { 121 SetPropertyChangeImpl instance = new SetPropertyChangeImpl(); 122 instance.setChange(template.getChange()); 123 instance.setPreviousValue(template.getPreviousValue()); 124 instance.setNextValue(template.getNextValue()); 125 instance.setPath(template.getPath()); 126 return instance; 127 } 128 129 /** 130 * factory method to create a deep copy of SetPropertyChange 131 * @param template instance to be copied 132 * @return copy instance 133 */ 134 @Nullable 135 public static SetPropertyChange deepCopy(@Nullable final SetPropertyChange template) { 136 if (template == null) { 137 return null; 138 } 139 SetPropertyChangeImpl instance = new SetPropertyChangeImpl(); 140 instance.setChange(template.getChange()); 141 instance.setPreviousValue(template.getPreviousValue()); 142 instance.setNextValue(template.getNextValue()); 143 instance.setPath(template.getPath()); 144 return instance; 145 } 146 147 /** 148 * builder factory method for SetPropertyChange 149 * @return builder 150 */ 151 public static SetPropertyChangeBuilder builder() { 152 return SetPropertyChangeBuilder.of(); 153 } 154 155 /** 156 * create builder for SetPropertyChange instance 157 * @param template instance with prefilled values for the builder 158 * @return builder 159 */ 160 public static SetPropertyChangeBuilder builder(final SetPropertyChange template) { 161 return SetPropertyChangeBuilder.of(template); 162 } 163 164 /** 165 * accessor map function 166 * @param <T> mapped type 167 * @param helper function to map the object 168 * @return mapped value 169 */ 170 default <T> T withSetPropertyChange(Function<SetPropertyChange, T> helper) { 171 return helper.apply(this); 172 } 173 174 /** 175 * gives a TypeReference for usage with Jackson DataBind 176 * @return TypeReference 177 */ 178 public static com.fasterxml.jackson.core.type.TypeReference<SetPropertyChange> typeReference() { 179 return new com.fasterxml.jackson.core.type.TypeReference<SetPropertyChange>() { 180 @Override 181 public String toString() { 182 return "TypeReference<SetPropertyChange>"; 183 } 184 }; 185 } 186}