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