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