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