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.CustomFields; 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 Price Custom Type 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 * SetProductPriceCustomTypeChange setProductPriceCustomTypeChange = SetProductPriceCustomTypeChange.builder() 026 * .change("{change}") 027 * .previousValue(previousValueBuilder -> previousValueBuilder) 028 * .nextValue(nextValueBuilder -> nextValueBuilder) 029 * .catalogData("{catalogData}") 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 = SetProductPriceCustomTypeChangeImpl.class) 036public interface SetProductPriceCustomTypeChange extends Change { 037 038 /** 039 * discriminator value for SetProductPriceCustomTypeChange 040 */ 041 String SET_PRODUCT_PRICE_CUSTOM_TYPE_CHANGE = "SetProductPriceCustomTypeChange"; 042 043 /** 044 * 045 * @return type 046 */ 047 @NotNull 048 @JsonProperty("type") 049 public String getType(); 050 051 /** 052 * 053 * @return change 054 */ 055 @NotNull 056 @JsonProperty("change") 057 public String getChange(); 058 059 /** 060 * <p>Value before the change.</p> 061 * @return previousValue 062 */ 063 @NotNull 064 @Valid 065 @JsonProperty("previousValue") 066 public CustomFields getPreviousValue(); 067 068 /** 069 * <p>Value after the change.</p> 070 * @return nextValue 071 */ 072 @NotNull 073 @Valid 074 @JsonProperty("nextValue") 075 public CustomFields getNextValue(); 076 077 /** 078 * <ul> 079 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 080 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 081 * </ul> 082 * @return catalogData 083 */ 084 @NotNull 085 @JsonProperty("catalogData") 086 public String getCatalogData(); 087 088 /** 089 * set change 090 * @param change value to be set 091 */ 092 093 public void setChange(final String change); 094 095 /** 096 * <p>Value before the change.</p> 097 * @param previousValue value to be set 098 */ 099 100 public void setPreviousValue(final CustomFields previousValue); 101 102 /** 103 * <p>Value after the change.</p> 104 * @param nextValue value to be set 105 */ 106 107 public void setNextValue(final CustomFields nextValue); 108 109 /** 110 * <ul> 111 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 112 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 113 * </ul> 114 * @param catalogData value to be set 115 */ 116 117 public void setCatalogData(final String catalogData); 118 119 /** 120 * factory method 121 * @return instance of SetProductPriceCustomTypeChange 122 */ 123 public static SetProductPriceCustomTypeChange of() { 124 return new SetProductPriceCustomTypeChangeImpl(); 125 } 126 127 /** 128 * factory method to create a shallow copy SetProductPriceCustomTypeChange 129 * @param template instance to be copied 130 * @return copy instance 131 */ 132 public static SetProductPriceCustomTypeChange of(final SetProductPriceCustomTypeChange template) { 133 SetProductPriceCustomTypeChangeImpl instance = new SetProductPriceCustomTypeChangeImpl(); 134 instance.setChange(template.getChange()); 135 instance.setPreviousValue(template.getPreviousValue()); 136 instance.setNextValue(template.getNextValue()); 137 instance.setCatalogData(template.getCatalogData()); 138 return instance; 139 } 140 141 /** 142 * factory method to create a deep copy of SetProductPriceCustomTypeChange 143 * @param template instance to be copied 144 * @return copy instance 145 */ 146 @Nullable 147 public static SetProductPriceCustomTypeChange deepCopy(@Nullable final SetProductPriceCustomTypeChange template) { 148 if (template == null) { 149 return null; 150 } 151 SetProductPriceCustomTypeChangeImpl instance = new SetProductPriceCustomTypeChangeImpl(); 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.setCatalogData(template.getCatalogData()); 157 return instance; 158 } 159 160 /** 161 * builder factory method for SetProductPriceCustomTypeChange 162 * @return builder 163 */ 164 public static SetProductPriceCustomTypeChangeBuilder builder() { 165 return SetProductPriceCustomTypeChangeBuilder.of(); 166 } 167 168 /** 169 * create builder for SetProductPriceCustomTypeChange instance 170 * @param template instance with prefilled values for the builder 171 * @return builder 172 */ 173 public static SetProductPriceCustomTypeChangeBuilder builder(final SetProductPriceCustomTypeChange template) { 174 return SetProductPriceCustomTypeChangeBuilder.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 withSetProductPriceCustomTypeChange(Function<SetProductPriceCustomTypeChange, 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<SetProductPriceCustomTypeChange> typeReference() { 192 return new com.fasterxml.jackson.core.type.TypeReference<SetProductPriceCustomTypeChange>() { 193 @Override 194 public String toString() { 195 return "TypeReference<SetProductPriceCustomTypeChange>"; 196 } 197 }; 198 } 199}