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 Change EnumValue Label 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 * ChangeEnumValueLabelChange changeEnumValueLabelChange = ChangeEnumValueLabelChange.builder() 024 * .change("{change}") 025 * .previousValue("{previousValue}") 026 * .nextValue("{nextValue}") 027 * .fieldName("{fieldName}") 028 * .valueKey("{valueKey}") 029 * .build() 030 * </code></pre> 031 * </div> 032 */ 033@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 034@JsonDeserialize(as = ChangeEnumValueLabelChangeImpl.class) 035public interface ChangeEnumValueLabelChange extends Change { 036 037 /** 038 * discriminator value for ChangeEnumValueLabelChange 039 */ 040 String CHANGE_ENUM_VALUE_LABEL_CHANGE = "ChangeEnumValueLabelChange"; 041 042 /** 043 * 044 * @return type 045 */ 046 @NotNull 047 @JsonProperty("type") 048 public String getType(); 049 050 /** 051 * 052 * @return change 053 */ 054 @NotNull 055 @JsonProperty("change") 056 public String getChange(); 057 058 /** 059 * <p>Value before the change.</p> 060 * @return previousValue 061 */ 062 @NotNull 063 @JsonProperty("previousValue") 064 public String getPreviousValue(); 065 066 /** 067 * <p>Value after the change.</p> 068 * @return nextValue 069 */ 070 @NotNull 071 @JsonProperty("nextValue") 072 public String getNextValue(); 073 074 /** 075 * <p>Name of the updated FieldDefinition.</p> 076 * @return fieldName 077 */ 078 @NotNull 079 @JsonProperty("fieldName") 080 public String getFieldName(); 081 082 /** 083 * <p>Key of the updated values.</p> 084 * @return valueKey 085 */ 086 @NotNull 087 @JsonProperty("valueKey") 088 public String getValueKey(); 089 090 /** 091 * set change 092 * @param change value to be set 093 */ 094 095 public void setChange(final String change); 096 097 /** 098 * <p>Value before the change.</p> 099 * @param previousValue value to be set 100 */ 101 102 public void setPreviousValue(final String previousValue); 103 104 /** 105 * <p>Value after the change.</p> 106 * @param nextValue value to be set 107 */ 108 109 public void setNextValue(final String nextValue); 110 111 /** 112 * <p>Name of the updated FieldDefinition.</p> 113 * @param fieldName value to be set 114 */ 115 116 public void setFieldName(final String fieldName); 117 118 /** 119 * <p>Key of the updated values.</p> 120 * @param valueKey value to be set 121 */ 122 123 public void setValueKey(final String valueKey); 124 125 /** 126 * factory method 127 * @return instance of ChangeEnumValueLabelChange 128 */ 129 public static ChangeEnumValueLabelChange of() { 130 return new ChangeEnumValueLabelChangeImpl(); 131 } 132 133 /** 134 * factory method to create a shallow copy ChangeEnumValueLabelChange 135 * @param template instance to be copied 136 * @return copy instance 137 */ 138 public static ChangeEnumValueLabelChange of(final ChangeEnumValueLabelChange template) { 139 ChangeEnumValueLabelChangeImpl instance = new ChangeEnumValueLabelChangeImpl(); 140 instance.setChange(template.getChange()); 141 instance.setPreviousValue(template.getPreviousValue()); 142 instance.setNextValue(template.getNextValue()); 143 instance.setFieldName(template.getFieldName()); 144 instance.setValueKey(template.getValueKey()); 145 return instance; 146 } 147 148 /** 149 * factory method to create a deep copy of ChangeEnumValueLabelChange 150 * @param template instance to be copied 151 * @return copy instance 152 */ 153 @Nullable 154 public static ChangeEnumValueLabelChange deepCopy(@Nullable final ChangeEnumValueLabelChange template) { 155 if (template == null) { 156 return null; 157 } 158 ChangeEnumValueLabelChangeImpl instance = new ChangeEnumValueLabelChangeImpl(); 159 instance.setChange(template.getChange()); 160 instance.setPreviousValue(template.getPreviousValue()); 161 instance.setNextValue(template.getNextValue()); 162 instance.setFieldName(template.getFieldName()); 163 instance.setValueKey(template.getValueKey()); 164 return instance; 165 } 166 167 /** 168 * builder factory method for ChangeEnumValueLabelChange 169 * @return builder 170 */ 171 public static ChangeEnumValueLabelChangeBuilder builder() { 172 return ChangeEnumValueLabelChangeBuilder.of(); 173 } 174 175 /** 176 * create builder for ChangeEnumValueLabelChange instance 177 * @param template instance with prefilled values for the builder 178 * @return builder 179 */ 180 public static ChangeEnumValueLabelChangeBuilder builder(final ChangeEnumValueLabelChange template) { 181 return ChangeEnumValueLabelChangeBuilder.of(template); 182 } 183 184 /** 185 * accessor map function 186 * @param <T> mapped type 187 * @param helper function to map the object 188 * @return mapped value 189 */ 190 default <T> T withChangeEnumValueLabelChange(Function<ChangeEnumValueLabelChange, T> helper) { 191 return helper.apply(this); 192 } 193 194 /** 195 * gives a TypeReference for usage with Jackson DataBind 196 * @return TypeReference 197 */ 198 public static com.fasterxml.jackson.core.type.TypeReference<ChangeEnumValueLabelChange> typeReference() { 199 return new com.fasterxml.jackson.core.type.TypeReference<ChangeEnumValueLabelChange>() { 200 @Override 201 public String toString() { 202 return "TypeReference<ChangeEnumValueLabelChange>"; 203 } 204 }; 205 } 206}