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.Asset; 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 following update actions:</p> 020 * <ul> 021 * <li>Remove Asset on Categories.</li> 022 * <li>Remove Asset on Products.</li> 023 * </ul> 024 * 025 * <hr> 026 * Example to create an instance using the builder pattern 027 * <div class=code-example> 028 * <pre><code class='java'> 029 * RemoveAssetChange removeAssetChange = RemoveAssetChange.builder() 030 * .change("{change}") 031 * .previousValue(previousValueBuilder -> previousValueBuilder) 032 * .build() 033 * </code></pre> 034 * </div> 035 */ 036@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 037@JsonDeserialize(as = RemoveAssetChangeImpl.class) 038public interface RemoveAssetChange extends Change { 039 040 /** 041 * discriminator value for RemoveAssetChange 042 */ 043 String REMOVE_ASSET_CHANGE = "RemoveAssetChange"; 044 045 /** 046 * 047 * @return change 048 */ 049 @NotNull 050 @JsonProperty("change") 051 public String getChange(); 052 053 /** 054 * 055 * @return type 056 */ 057 @NotNull 058 @JsonProperty("type") 059 public String getType(); 060 061 /** 062 * <p>Value before the change.</p> 063 * @return previousValue 064 */ 065 @NotNull 066 @Valid 067 @JsonProperty("previousValue") 068 public Asset getPreviousValue(); 069 070 /** 071 * set change 072 * @param change value to be set 073 */ 074 075 public void setChange(final String change); 076 077 /** 078 * <p>Value before the change.</p> 079 * @param previousValue value to be set 080 */ 081 082 public void setPreviousValue(final Asset previousValue); 083 084 /** 085 * factory method 086 * @return instance of RemoveAssetChange 087 */ 088 public static RemoveAssetChange of() { 089 return new RemoveAssetChangeImpl(); 090 } 091 092 /** 093 * factory method to create a shallow copy RemoveAssetChange 094 * @param template instance to be copied 095 * @return copy instance 096 */ 097 public static RemoveAssetChange of(final RemoveAssetChange template) { 098 RemoveAssetChangeImpl instance = new RemoveAssetChangeImpl(); 099 instance.setChange(template.getChange()); 100 instance.setPreviousValue(template.getPreviousValue()); 101 return instance; 102 } 103 104 /** 105 * factory method to create a deep copy of RemoveAssetChange 106 * @param template instance to be copied 107 * @return copy instance 108 */ 109 @Nullable 110 public static RemoveAssetChange deepCopy(@Nullable final RemoveAssetChange template) { 111 if (template == null) { 112 return null; 113 } 114 RemoveAssetChangeImpl instance = new RemoveAssetChangeImpl(); 115 instance.setChange(template.getChange()); 116 instance.setPreviousValue(com.commercetools.history.models.common.Asset.deepCopy(template.getPreviousValue())); 117 return instance; 118 } 119 120 /** 121 * builder factory method for RemoveAssetChange 122 * @return builder 123 */ 124 public static RemoveAssetChangeBuilder builder() { 125 return RemoveAssetChangeBuilder.of(); 126 } 127 128 /** 129 * create builder for RemoveAssetChange instance 130 * @param template instance with prefilled values for the builder 131 * @return builder 132 */ 133 public static RemoveAssetChangeBuilder builder(final RemoveAssetChange template) { 134 return RemoveAssetChangeBuilder.of(template); 135 } 136 137 /** 138 * accessor map function 139 * @param <T> mapped type 140 * @param helper function to map the object 141 * @return mapped value 142 */ 143 default <T> T withRemoveAssetChange(Function<RemoveAssetChange, T> helper) { 144 return helper.apply(this); 145 } 146 147 /** 148 * gives a TypeReference for usage with Jackson DataBind 149 * @return TypeReference 150 */ 151 public static com.fasterxml.jackson.core.type.TypeReference<RemoveAssetChange> typeReference() { 152 return new com.fasterxml.jackson.core.type.TypeReference<RemoveAssetChange>() { 153 @Override 154 public String toString() { 155 return "TypeReference<RemoveAssetChange>"; 156 } 157 }; 158 } 159}