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