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.Address; 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 Address Custom Field 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 * SetAddressCustomFieldChange setAddressCustomFieldChange = SetAddressCustomFieldChange.builder() 026 * .change("{change}") 027 * .address(addressBuilder -> addressBuilder) 028 * .name("{name}") 029 * .customTypeId("{customTypeId}") 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 = SetAddressCustomFieldChangeImpl.class) 036public interface SetAddressCustomFieldChange extends Change { 037 038 /** 039 * discriminator value for SetAddressCustomFieldChange 040 */ 041 String SET_ADDRESS_CUSTOM_FIELD_CHANGE = "SetAddressCustomFieldChange"; 042 043 /** 044 * 045 * @return change 046 */ 047 @NotNull 048 @JsonProperty("change") 049 public String getChange(); 050 051 /** 052 * 053 * @return type 054 */ 055 @NotNull 056 @JsonProperty("type") 057 public String getType(); 058 059 /** 060 * <p>Address which was extended.</p> 061 * @return address 062 */ 063 @NotNull 064 @Valid 065 @JsonProperty("address") 066 public Address getAddress(); 067 068 /** 069 * <p>Name of the Custom Field.</p> 070 * @return name 071 */ 072 @NotNull 073 @JsonProperty("name") 074 public String getName(); 075 076 /** 077 * <p><code>id</code> of the referenced Type.</p> 078 * @return customTypeId 079 */ 080 @NotNull 081 @JsonProperty("customTypeId") 082 public String getCustomTypeId(); 083 084 /** 085 * <p>Value before the change.</p> 086 * @return previousValue 087 */ 088 @NotNull 089 @JsonProperty("previousValue") 090 public Object getPreviousValue(); 091 092 /** 093 * <p>Value after the change.</p> 094 * @return nextValue 095 */ 096 @NotNull 097 @JsonProperty("nextValue") 098 public Object getNextValue(); 099 100 /** 101 * set change 102 * @param change value to be set 103 */ 104 105 public void setChange(final String change); 106 107 /** 108 * <p>Address which was extended.</p> 109 * @param address value to be set 110 */ 111 112 public void setAddress(final Address address); 113 114 /** 115 * <p>Name of the Custom Field.</p> 116 * @param name value to be set 117 */ 118 119 public void setName(final String name); 120 121 /** 122 * <p><code>id</code> of the referenced Type.</p> 123 * @param customTypeId value to be set 124 */ 125 126 public void setCustomTypeId(final String customTypeId); 127 128 /** 129 * <p>Value before the change.</p> 130 * @param previousValue value to be set 131 */ 132 133 public void setPreviousValue(final Object previousValue); 134 135 /** 136 * <p>Value after the change.</p> 137 * @param nextValue value to be set 138 */ 139 140 public void setNextValue(final Object nextValue); 141 142 /** 143 * factory method 144 * @return instance of SetAddressCustomFieldChange 145 */ 146 public static SetAddressCustomFieldChange of() { 147 return new SetAddressCustomFieldChangeImpl(); 148 } 149 150 /** 151 * factory method to create a shallow copy SetAddressCustomFieldChange 152 * @param template instance to be copied 153 * @return copy instance 154 */ 155 public static SetAddressCustomFieldChange of(final SetAddressCustomFieldChange template) { 156 SetAddressCustomFieldChangeImpl instance = new SetAddressCustomFieldChangeImpl(); 157 instance.setChange(template.getChange()); 158 instance.setAddress(template.getAddress()); 159 instance.setName(template.getName()); 160 instance.setCustomTypeId(template.getCustomTypeId()); 161 instance.setPreviousValue(template.getPreviousValue()); 162 instance.setNextValue(template.getNextValue()); 163 return instance; 164 } 165 166 /** 167 * factory method to create a deep copy of SetAddressCustomFieldChange 168 * @param template instance to be copied 169 * @return copy instance 170 */ 171 @Nullable 172 public static SetAddressCustomFieldChange deepCopy(@Nullable final SetAddressCustomFieldChange template) { 173 if (template == null) { 174 return null; 175 } 176 SetAddressCustomFieldChangeImpl instance = new SetAddressCustomFieldChangeImpl(); 177 instance.setChange(template.getChange()); 178 instance.setAddress(com.commercetools.history.models.common.Address.deepCopy(template.getAddress())); 179 instance.setName(template.getName()); 180 instance.setCustomTypeId(template.getCustomTypeId()); 181 instance.setPreviousValue(template.getPreviousValue()); 182 instance.setNextValue(template.getNextValue()); 183 return instance; 184 } 185 186 /** 187 * builder factory method for SetAddressCustomFieldChange 188 * @return builder 189 */ 190 public static SetAddressCustomFieldChangeBuilder builder() { 191 return SetAddressCustomFieldChangeBuilder.of(); 192 } 193 194 /** 195 * create builder for SetAddressCustomFieldChange instance 196 * @param template instance with prefilled values for the builder 197 * @return builder 198 */ 199 public static SetAddressCustomFieldChangeBuilder builder(final SetAddressCustomFieldChange template) { 200 return SetAddressCustomFieldChangeBuilder.of(template); 201 } 202 203 /** 204 * accessor map function 205 * @param <T> mapped type 206 * @param helper function to map the object 207 * @return mapped value 208 */ 209 default <T> T withSetAddressCustomFieldChange(Function<SetAddressCustomFieldChange, T> helper) { 210 return helper.apply(this); 211 } 212 213 /** 214 * gives a TypeReference for usage with Jackson DataBind 215 * @return TypeReference 216 */ 217 public static com.fasterxml.jackson.core.type.TypeReference<SetAddressCustomFieldChange> typeReference() { 218 return new com.fasterxml.jackson.core.type.TypeReference<SetAddressCustomFieldChange>() { 219 @Override 220 public String toString() { 221 return "TypeReference<SetAddressCustomFieldChange>"; 222 } 223 }; 224 } 225}