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