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