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.LocalizedString; 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 following update actions:</p> 020 * <ul> 021 * <li>Change the label of a LocalizedEnumValue on Product Types.</li> 022 * <li>Change LocalizedEnumValue Label on Types.</li> 023 * </ul> 024 * 025 * <hr> 026 * Example to create an instance using the builder pattern 027 * <div class=code-example> 028 * <pre><code class='java'> 029 * ChangeLocalizedEnumValueLabelChange changeLocalizedEnumValueLabelChange = ChangeLocalizedEnumValueLabelChange.builder() 030 * .change("{change}") 031 * .previousValue(previousValueBuilder -> previousValueBuilder) 032 * .nextValue(nextValueBuilder -> nextValueBuilder) 033 * .fieldName("{fieldName}") 034 * .attributeName("{attributeName}") 035 * .valueKey("{valueKey}") 036 * .build() 037 * </code></pre> 038 * </div> 039 */ 040@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 041@JsonDeserialize(as = ChangeLocalizedEnumValueLabelChangeImpl.class) 042public interface ChangeLocalizedEnumValueLabelChange extends Change { 043 044 /** 045 * discriminator value for ChangeLocalizedEnumValueLabelChange 046 */ 047 String CHANGE_LOCALIZED_ENUM_VALUE_LABEL_CHANGE = "ChangeLocalizedEnumValueLabelChange"; 048 049 /** 050 * 051 * @return type 052 */ 053 @NotNull 054 @JsonProperty("type") 055 public String getType(); 056 057 /** 058 * 059 * @return change 060 */ 061 @NotNull 062 @JsonProperty("change") 063 public String getChange(); 064 065 /** 066 * <p>Value before the change.</p> 067 * @return previousValue 068 */ 069 @NotNull 070 @Valid 071 @JsonProperty("previousValue") 072 public LocalizedString getPreviousValue(); 073 074 /** 075 * <p>Value after the change.</p> 076 * @return nextValue 077 */ 078 @NotNull 079 @Valid 080 @JsonProperty("nextValue") 081 public LocalizedString getNextValue(); 082 083 /** 084 * <p>Name of the updated FieldDefinition; only present on changes to Types.</p> 085 * @return fieldName 086 */ 087 @NotNull 088 @JsonProperty("fieldName") 089 public String getFieldName(); 090 091 /** 092 * <p>Name of the updated AttributeDefinition; only present on changes to Product Types.</p> 093 * @return attributeName 094 */ 095 @NotNull 096 @JsonProperty("attributeName") 097 public String getAttributeName(); 098 099 /** 100 * <p>Key of the updated values.</p> 101 * @return valueKey 102 */ 103 @NotNull 104 @JsonProperty("valueKey") 105 public String getValueKey(); 106 107 /** 108 * set change 109 * @param change value to be set 110 */ 111 112 public void setChange(final String change); 113 114 /** 115 * <p>Value before the change.</p> 116 * @param previousValue value to be set 117 */ 118 119 public void setPreviousValue(final LocalizedString previousValue); 120 121 /** 122 * <p>Value after the change.</p> 123 * @param nextValue value to be set 124 */ 125 126 public void setNextValue(final LocalizedString nextValue); 127 128 /** 129 * <p>Name of the updated FieldDefinition; only present on changes to Types.</p> 130 * @param fieldName value to be set 131 */ 132 133 public void setFieldName(final String fieldName); 134 135 /** 136 * <p>Name of the updated AttributeDefinition; only present on changes to Product Types.</p> 137 * @param attributeName value to be set 138 */ 139 140 public void setAttributeName(final String attributeName); 141 142 /** 143 * <p>Key of the updated values.</p> 144 * @param valueKey value to be set 145 */ 146 147 public void setValueKey(final String valueKey); 148 149 /** 150 * factory method 151 * @return instance of ChangeLocalizedEnumValueLabelChange 152 */ 153 public static ChangeLocalizedEnumValueLabelChange of() { 154 return new ChangeLocalizedEnumValueLabelChangeImpl(); 155 } 156 157 /** 158 * factory method to create a shallow copy ChangeLocalizedEnumValueLabelChange 159 * @param template instance to be copied 160 * @return copy instance 161 */ 162 public static ChangeLocalizedEnumValueLabelChange of(final ChangeLocalizedEnumValueLabelChange template) { 163 ChangeLocalizedEnumValueLabelChangeImpl instance = new ChangeLocalizedEnumValueLabelChangeImpl(); 164 instance.setChange(template.getChange()); 165 instance.setPreviousValue(template.getPreviousValue()); 166 instance.setNextValue(template.getNextValue()); 167 instance.setFieldName(template.getFieldName()); 168 instance.setAttributeName(template.getAttributeName()); 169 instance.setValueKey(template.getValueKey()); 170 return instance; 171 } 172 173 /** 174 * factory method to create a deep copy of ChangeLocalizedEnumValueLabelChange 175 * @param template instance to be copied 176 * @return copy instance 177 */ 178 @Nullable 179 public static ChangeLocalizedEnumValueLabelChange deepCopy( 180 @Nullable final ChangeLocalizedEnumValueLabelChange template) { 181 if (template == null) { 182 return null; 183 } 184 ChangeLocalizedEnumValueLabelChangeImpl instance = new ChangeLocalizedEnumValueLabelChangeImpl(); 185 instance.setChange(template.getChange()); 186 instance.setPreviousValue( 187 com.commercetools.history.models.common.LocalizedString.deepCopy(template.getPreviousValue())); 188 instance.setNextValue( 189 com.commercetools.history.models.common.LocalizedString.deepCopy(template.getNextValue())); 190 instance.setFieldName(template.getFieldName()); 191 instance.setAttributeName(template.getAttributeName()); 192 instance.setValueKey(template.getValueKey()); 193 return instance; 194 } 195 196 /** 197 * builder factory method for ChangeLocalizedEnumValueLabelChange 198 * @return builder 199 */ 200 public static ChangeLocalizedEnumValueLabelChangeBuilder builder() { 201 return ChangeLocalizedEnumValueLabelChangeBuilder.of(); 202 } 203 204 /** 205 * create builder for ChangeLocalizedEnumValueLabelChange instance 206 * @param template instance with prefilled values for the builder 207 * @return builder 208 */ 209 public static ChangeLocalizedEnumValueLabelChangeBuilder builder( 210 final ChangeLocalizedEnumValueLabelChange template) { 211 return ChangeLocalizedEnumValueLabelChangeBuilder.of(template); 212 } 213 214 /** 215 * accessor map function 216 * @param <T> mapped type 217 * @param helper function to map the object 218 * @return mapped value 219 */ 220 default <T> T withChangeLocalizedEnumValueLabelChange(Function<ChangeLocalizedEnumValueLabelChange, T> helper) { 221 return helper.apply(this); 222 } 223 224 /** 225 * gives a TypeReference for usage with Jackson DataBind 226 * @return TypeReference 227 */ 228 public static com.fasterxml.jackson.core.type.TypeReference<ChangeLocalizedEnumValueLabelChange> typeReference() { 229 return new com.fasterxml.jackson.core.type.TypeReference<ChangeLocalizedEnumValueLabelChange>() { 230 @Override 231 public String toString() { 232 return "TypeReference<ChangeLocalizedEnumValueLabelChange>"; 233 } 234 }; 235 } 236}