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.CustomFields; 013import com.commercetools.history.models.common.LocalizedString; 014import com.fasterxml.jackson.annotation.*; 015import com.fasterxml.jackson.databind.annotation.*; 016 017import io.vrap.rmf.base.client.utils.Generated; 018 019/** 020 * <p>Change triggered by the following update actions:</p> 021 * <ul> 022 * <li>Set CustomLineItem CustomField on Orders.</li> 023 * <li>Set CustomLineItem CustomField on Staged Orders.</li> 024 * </ul> 025 * 026 * <hr> 027 * Example to create an instance using the builder pattern 028 * <div class=code-example> 029 * <pre><code class='java'> 030 * SetCustomLineItemCustomTypeChange setCustomLineItemCustomTypeChange = SetCustomLineItemCustomTypeChange.builder() 031 * .change("{change}") 032 * .previousValue(previousValueBuilder -> previousValueBuilder) 033 * .nextValue(nextValueBuilder -> nextValueBuilder) 034 * .customLineItem(customLineItemBuilder -> customLineItemBuilder) 035 * .customLineItemId("{customLineItemId}") 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 = SetCustomLineItemCustomTypeChangeImpl.class) 042public interface SetCustomLineItemCustomTypeChange extends Change { 043 044 /** 045 * discriminator value for SetCustomLineItemCustomTypeChange 046 */ 047 String SET_CUSTOM_LINE_ITEM_CUSTOM_TYPE_CHANGE = "SetCustomLineItemCustomTypeChange"; 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 CustomFields getPreviousValue(); 073 074 /** 075 * <p>Value after the change.</p> 076 * @return nextValue 077 */ 078 @NotNull 079 @Valid 080 @JsonProperty("nextValue") 081 public CustomFields getNextValue(); 082 083 /** 084 * <p>Name of the updated CustomLineItem.</p> 085 * @return customLineItem 086 */ 087 @NotNull 088 @Valid 089 @JsonProperty("customLineItem") 090 public LocalizedString getCustomLineItem(); 091 092 /** 093 * <p><code>id</code> of the updated CustomLineItem.</p> 094 * @return customLineItemId 095 */ 096 @NotNull 097 @JsonProperty("customLineItemId") 098 public String getCustomLineItemId(); 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 CustomFields previousValue); 113 114 /** 115 * <p>Value after the change.</p> 116 * @param nextValue value to be set 117 */ 118 119 public void setNextValue(final CustomFields nextValue); 120 121 /** 122 * <p>Name of the updated CustomLineItem.</p> 123 * @param customLineItem value to be set 124 */ 125 126 public void setCustomLineItem(final LocalizedString customLineItem); 127 128 /** 129 * <p><code>id</code> of the updated CustomLineItem.</p> 130 * @param customLineItemId value to be set 131 */ 132 133 public void setCustomLineItemId(final String customLineItemId); 134 135 /** 136 * factory method 137 * @return instance of SetCustomLineItemCustomTypeChange 138 */ 139 public static SetCustomLineItemCustomTypeChange of() { 140 return new SetCustomLineItemCustomTypeChangeImpl(); 141 } 142 143 /** 144 * factory method to create a shallow copy SetCustomLineItemCustomTypeChange 145 * @param template instance to be copied 146 * @return copy instance 147 */ 148 public static SetCustomLineItemCustomTypeChange of(final SetCustomLineItemCustomTypeChange template) { 149 SetCustomLineItemCustomTypeChangeImpl instance = new SetCustomLineItemCustomTypeChangeImpl(); 150 instance.setChange(template.getChange()); 151 instance.setPreviousValue(template.getPreviousValue()); 152 instance.setNextValue(template.getNextValue()); 153 instance.setCustomLineItem(template.getCustomLineItem()); 154 instance.setCustomLineItemId(template.getCustomLineItemId()); 155 return instance; 156 } 157 158 /** 159 * factory method to create a deep copy of SetCustomLineItemCustomTypeChange 160 * @param template instance to be copied 161 * @return copy instance 162 */ 163 @Nullable 164 public static SetCustomLineItemCustomTypeChange deepCopy( 165 @Nullable final SetCustomLineItemCustomTypeChange template) { 166 if (template == null) { 167 return null; 168 } 169 SetCustomLineItemCustomTypeChangeImpl instance = new SetCustomLineItemCustomTypeChangeImpl(); 170 instance.setChange(template.getChange()); 171 instance.setPreviousValue( 172 com.commercetools.history.models.common.CustomFields.deepCopy(template.getPreviousValue())); 173 instance.setNextValue(com.commercetools.history.models.common.CustomFields.deepCopy(template.getNextValue())); 174 instance.setCustomLineItem( 175 com.commercetools.history.models.common.LocalizedString.deepCopy(template.getCustomLineItem())); 176 instance.setCustomLineItemId(template.getCustomLineItemId()); 177 return instance; 178 } 179 180 /** 181 * builder factory method for SetCustomLineItemCustomTypeChange 182 * @return builder 183 */ 184 public static SetCustomLineItemCustomTypeChangeBuilder builder() { 185 return SetCustomLineItemCustomTypeChangeBuilder.of(); 186 } 187 188 /** 189 * create builder for SetCustomLineItemCustomTypeChange instance 190 * @param template instance with prefilled values for the builder 191 * @return builder 192 */ 193 public static SetCustomLineItemCustomTypeChangeBuilder builder(final SetCustomLineItemCustomTypeChange template) { 194 return SetCustomLineItemCustomTypeChangeBuilder.of(template); 195 } 196 197 /** 198 * accessor map function 199 * @param <T> mapped type 200 * @param helper function to map the object 201 * @return mapped value 202 */ 203 default <T> T withSetCustomLineItemCustomTypeChange(Function<SetCustomLineItemCustomTypeChange, T> helper) { 204 return helper.apply(this); 205 } 206 207 /** 208 * gives a TypeReference for usage with Jackson DataBind 209 * @return TypeReference 210 */ 211 public static com.fasterxml.jackson.core.type.TypeReference<SetCustomLineItemCustomTypeChange> typeReference() { 212 return new com.fasterxml.jackson.core.type.TypeReference<SetCustomLineItemCustomTypeChange>() { 213 @Override 214 public String toString() { 215 return "TypeReference<SetCustomLineItemCustomTypeChange>"; 216 } 217 }; 218 } 219}