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.TaxedItemPrice; 014import com.fasterxml.jackson.annotation.*; 015import com.fasterxml.jackson.databind.annotation.*; 016 017import io.vrap.rmf.base.client.utils.Generated; 018 019/** 020 * SetLineItemTaxedPriceChange 021 * 022 * <hr> 023 * Example to create an instance using the builder pattern 024 * <div class=code-example> 025 * <pre><code class='java'> 026 * SetLineItemTaxedPriceChange setLineItemTaxedPriceChange = SetLineItemTaxedPriceChange.builder() 027 * .change("{change}") 028 * .previousValue(previousValueBuilder -> previousValueBuilder) 029 * .nextValue(nextValueBuilder -> nextValueBuilder) 030 * .lineItem(lineItemBuilder -> lineItemBuilder) 031 * .lineItemId("{lineItemId}") 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 = SetLineItemTaxedPriceChangeImpl.class) 038public interface SetLineItemTaxedPriceChange extends Change { 039 040 /** 041 * discriminator value for SetLineItemTaxedPriceChange 042 */ 043 String SET_LINE_ITEM_TAXED_PRICE_CHANGE = "SetLineItemTaxedPriceChange"; 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 TaxedItemPrice getPreviousValue(); 069 070 /** 071 * <p>Value after the change.</p> 072 * @return nextValue 073 */ 074 @NotNull 075 @Valid 076 @JsonProperty("nextValue") 077 public TaxedItemPrice getNextValue(); 078 079 /** 080 * <p>Name of the Product the Line Item is based on.</p> 081 * @return lineItem 082 */ 083 @NotNull 084 @Valid 085 @JsonProperty("lineItem") 086 public LocalizedString getLineItem(); 087 088 /** 089 * <p><code>id</code> of the updated LineItem.</p> 090 * @return lineItemId 091 */ 092 @NotNull 093 @JsonProperty("lineItemId") 094 public String getLineItemId(); 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 TaxedItemPrice previousValue); 109 110 /** 111 * <p>Value after the change.</p> 112 * @param nextValue value to be set 113 */ 114 115 public void setNextValue(final TaxedItemPrice nextValue); 116 117 /** 118 * <p>Name of the Product the Line Item is based on.</p> 119 * @param lineItem value to be set 120 */ 121 122 public void setLineItem(final LocalizedString lineItem); 123 124 /** 125 * <p><code>id</code> of the updated LineItem.</p> 126 * @param lineItemId value to be set 127 */ 128 129 public void setLineItemId(final String lineItemId); 130 131 /** 132 * factory method 133 * @return instance of SetLineItemTaxedPriceChange 134 */ 135 public static SetLineItemTaxedPriceChange of() { 136 return new SetLineItemTaxedPriceChangeImpl(); 137 } 138 139 /** 140 * factory method to create a shallow copy SetLineItemTaxedPriceChange 141 * @param template instance to be copied 142 * @return copy instance 143 */ 144 public static SetLineItemTaxedPriceChange of(final SetLineItemTaxedPriceChange template) { 145 SetLineItemTaxedPriceChangeImpl instance = new SetLineItemTaxedPriceChangeImpl(); 146 instance.setChange(template.getChange()); 147 instance.setPreviousValue(template.getPreviousValue()); 148 instance.setNextValue(template.getNextValue()); 149 instance.setLineItem(template.getLineItem()); 150 instance.setLineItemId(template.getLineItemId()); 151 return instance; 152 } 153 154 /** 155 * factory method to create a deep copy of SetLineItemTaxedPriceChange 156 * @param template instance to be copied 157 * @return copy instance 158 */ 159 @Nullable 160 public static SetLineItemTaxedPriceChange deepCopy(@Nullable final SetLineItemTaxedPriceChange template) { 161 if (template == null) { 162 return null; 163 } 164 SetLineItemTaxedPriceChangeImpl instance = new SetLineItemTaxedPriceChangeImpl(); 165 instance.setChange(template.getChange()); 166 instance.setPreviousValue( 167 com.commercetools.history.models.common.TaxedItemPrice.deepCopy(template.getPreviousValue())); 168 instance.setNextValue(com.commercetools.history.models.common.TaxedItemPrice.deepCopy(template.getNextValue())); 169 instance.setLineItem(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getLineItem())); 170 instance.setLineItemId(template.getLineItemId()); 171 return instance; 172 } 173 174 /** 175 * builder factory method for SetLineItemTaxedPriceChange 176 * @return builder 177 */ 178 public static SetLineItemTaxedPriceChangeBuilder builder() { 179 return SetLineItemTaxedPriceChangeBuilder.of(); 180 } 181 182 /** 183 * create builder for SetLineItemTaxedPriceChange instance 184 * @param template instance with prefilled values for the builder 185 * @return builder 186 */ 187 public static SetLineItemTaxedPriceChangeBuilder builder(final SetLineItemTaxedPriceChange template) { 188 return SetLineItemTaxedPriceChangeBuilder.of(template); 189 } 190 191 /** 192 * accessor map function 193 * @param <T> mapped type 194 * @param helper function to map the object 195 * @return mapped value 196 */ 197 default <T> T withSetLineItemTaxedPriceChange(Function<SetLineItemTaxedPriceChange, T> helper) { 198 return helper.apply(this); 199 } 200 201 /** 202 * gives a TypeReference for usage with Jackson DataBind 203 * @return TypeReference 204 */ 205 public static com.fasterxml.jackson.core.type.TypeReference<SetLineItemTaxedPriceChange> typeReference() { 206 return new com.fasterxml.jackson.core.type.TypeReference<SetLineItemTaxedPriceChange>() { 207 @Override 208 public String toString() { 209 return "TypeReference<SetLineItemTaxedPriceChange>"; 210 } 211 }; 212 } 213}