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