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