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