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.change_value.EnumValue; 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 Add PlainEnumValue to AttributeDefinition update action.</p> 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * AddPlainEnumValueChange addPlainEnumValueChange = AddPlainEnumValueChange.builder() 026 * .change("{change}") 027 * .nextValue(nextValueBuilder -> nextValueBuilder) 028 * .attributeName("{attributeName}") 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 = AddPlainEnumValueChangeImpl.class) 035public interface AddPlainEnumValueChange extends Change { 036 037 /** 038 * discriminator value for AddPlainEnumValueChange 039 */ 040 String ADD_PLAIN_ENUM_VALUE_CHANGE = "AddPlainEnumValueChange"; 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 after the change.</p> 060 * @return nextValue 061 */ 062 @NotNull 063 @Valid 064 @JsonProperty("nextValue") 065 public EnumValue getNextValue(); 066 067 /** 068 * <p>Name of the updated AttributeDefinition.</p> 069 * @return attributeName 070 */ 071 @NotNull 072 @JsonProperty("attributeName") 073 public String getAttributeName(); 074 075 /** 076 * set change 077 * @param change value to be set 078 */ 079 080 public void setChange(final String change); 081 082 /** 083 * <p>Value after the change.</p> 084 * @param nextValue value to be set 085 */ 086 087 public void setNextValue(final EnumValue nextValue); 088 089 /** 090 * <p>Name of the updated AttributeDefinition.</p> 091 * @param attributeName value to be set 092 */ 093 094 public void setAttributeName(final String attributeName); 095 096 /** 097 * factory method 098 * @return instance of AddPlainEnumValueChange 099 */ 100 public static AddPlainEnumValueChange of() { 101 return new AddPlainEnumValueChangeImpl(); 102 } 103 104 /** 105 * factory method to create a shallow copy AddPlainEnumValueChange 106 * @param template instance to be copied 107 * @return copy instance 108 */ 109 public static AddPlainEnumValueChange of(final AddPlainEnumValueChange template) { 110 AddPlainEnumValueChangeImpl instance = new AddPlainEnumValueChangeImpl(); 111 instance.setChange(template.getChange()); 112 instance.setNextValue(template.getNextValue()); 113 instance.setAttributeName(template.getAttributeName()); 114 return instance; 115 } 116 117 /** 118 * factory method to create a deep copy of AddPlainEnumValueChange 119 * @param template instance to be copied 120 * @return copy instance 121 */ 122 @Nullable 123 public static AddPlainEnumValueChange deepCopy(@Nullable final AddPlainEnumValueChange template) { 124 if (template == null) { 125 return null; 126 } 127 AddPlainEnumValueChangeImpl instance = new AddPlainEnumValueChangeImpl(); 128 instance.setChange(template.getChange()); 129 instance.setNextValue( 130 com.commercetools.history.models.change_value.EnumValue.deepCopy(template.getNextValue())); 131 instance.setAttributeName(template.getAttributeName()); 132 return instance; 133 } 134 135 /** 136 * builder factory method for AddPlainEnumValueChange 137 * @return builder 138 */ 139 public static AddPlainEnumValueChangeBuilder builder() { 140 return AddPlainEnumValueChangeBuilder.of(); 141 } 142 143 /** 144 * create builder for AddPlainEnumValueChange instance 145 * @param template instance with prefilled values for the builder 146 * @return builder 147 */ 148 public static AddPlainEnumValueChangeBuilder builder(final AddPlainEnumValueChange template) { 149 return AddPlainEnumValueChangeBuilder.of(template); 150 } 151 152 /** 153 * accessor map function 154 * @param <T> mapped type 155 * @param helper function to map the object 156 * @return mapped value 157 */ 158 default <T> T withAddPlainEnumValueChange(Function<AddPlainEnumValueChange, T> helper) { 159 return helper.apply(this); 160 } 161 162 /** 163 * gives a TypeReference for usage with Jackson DataBind 164 * @return TypeReference 165 */ 166 public static com.fasterxml.jackson.core.type.TypeReference<AddPlainEnumValueChange> typeReference() { 167 return new com.fasterxml.jackson.core.type.TypeReference<AddPlainEnumValueChange>() { 168 @Override 169 public String toString() { 170 return "TypeReference<AddPlainEnumValueChange>"; 171 } 172 }; 173 } 174}