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