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