001 002package com.commercetools.history.models.change_value; 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.SelectionMode; 012import com.fasterxml.jackson.annotation.*; 013import com.fasterxml.jackson.databind.annotation.*; 014 015import io.vrap.rmf.base.client.utils.Generated; 016 017/** 018 * ChangeTargetMultiBuyCustomLineItemsChangeValue 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * ChangeTargetMultiBuyCustomLineItemsChangeValue changeTargetMultiBuyCustomLineItemsChangeValue = ChangeTargetMultiBuyCustomLineItemsChangeValue.builder() 025 * .predicate("{predicate}") 026 * .triggerQuantity(1) 027 * .discountedQuantity(1) 028 * .maxOccurrence(1) 029 * .selectionMode(SelectionMode.CHEAPEST) 030 * .build() 031 * </code></pre> 032 * </div> 033 */ 034@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 035@JsonDeserialize(as = ChangeTargetMultiBuyCustomLineItemsChangeValueImpl.class) 036public interface ChangeTargetMultiBuyCustomLineItemsChangeValue extends ChangeTargetChangeValue { 037 038 /** 039 * discriminator value for ChangeTargetMultiBuyCustomLineItemsChangeValue 040 */ 041 String MULTI_BUY_CUSTOM_LINE_ITEMS = "multiBuyCustomLineItems"; 042 043 /** 044 * 045 * @return type 046 */ 047 @NotNull 048 @JsonProperty("type") 049 public String getType(); 050 051 /** 052 * <p>Valid CustomLineItem target predicate.</p> 053 * @return predicate 054 */ 055 @NotNull 056 @JsonProperty("predicate") 057 public String getPredicate(); 058 059 /** 060 * <p>Quantity of Custom Line Items that triggered the application of the discount.</p> 061 * @return triggerQuantity 062 */ 063 @NotNull 064 @JsonProperty("triggerQuantity") 065 public Integer getTriggerQuantity(); 066 067 /** 068 * <p>Quantity of Custom Line Items discounted per application of this discount.</p> 069 * @return discountedQuantity 070 */ 071 @NotNull 072 @JsonProperty("discountedQuantity") 073 public Integer getDiscountedQuantity(); 074 075 /** 076 * <p>Maximum number of times the discount is applicable.</p> 077 * @return maxOccurrence 078 */ 079 @NotNull 080 @JsonProperty("maxOccurrence") 081 public Integer getMaxOccurrence(); 082 083 /** 084 * <p>SelectionMode based on which particular Custom Line Items were discounted.</p> 085 * @return selectionMode 086 */ 087 @NotNull 088 @JsonProperty("selectionMode") 089 public SelectionMode getSelectionMode(); 090 091 /** 092 * <p>Valid CustomLineItem target predicate.</p> 093 * @param predicate value to be set 094 */ 095 096 public void setPredicate(final String predicate); 097 098 /** 099 * <p>Quantity of Custom Line Items that triggered the application of the discount.</p> 100 * @param triggerQuantity value to be set 101 */ 102 103 public void setTriggerQuantity(final Integer triggerQuantity); 104 105 /** 106 * <p>Quantity of Custom Line Items discounted per application of this discount.</p> 107 * @param discountedQuantity value to be set 108 */ 109 110 public void setDiscountedQuantity(final Integer discountedQuantity); 111 112 /** 113 * <p>Maximum number of times the discount is applicable.</p> 114 * @param maxOccurrence value to be set 115 */ 116 117 public void setMaxOccurrence(final Integer maxOccurrence); 118 119 /** 120 * <p>SelectionMode based on which particular Custom Line Items were discounted.</p> 121 * @param selectionMode value to be set 122 */ 123 124 public void setSelectionMode(final SelectionMode selectionMode); 125 126 /** 127 * factory method 128 * @return instance of ChangeTargetMultiBuyCustomLineItemsChangeValue 129 */ 130 public static ChangeTargetMultiBuyCustomLineItemsChangeValue of() { 131 return new ChangeTargetMultiBuyCustomLineItemsChangeValueImpl(); 132 } 133 134 /** 135 * factory method to create a shallow copy ChangeTargetMultiBuyCustomLineItemsChangeValue 136 * @param template instance to be copied 137 * @return copy instance 138 */ 139 public static ChangeTargetMultiBuyCustomLineItemsChangeValue of( 140 final ChangeTargetMultiBuyCustomLineItemsChangeValue template) { 141 ChangeTargetMultiBuyCustomLineItemsChangeValueImpl instance = new ChangeTargetMultiBuyCustomLineItemsChangeValueImpl(); 142 instance.setPredicate(template.getPredicate()); 143 instance.setTriggerQuantity(template.getTriggerQuantity()); 144 instance.setDiscountedQuantity(template.getDiscountedQuantity()); 145 instance.setMaxOccurrence(template.getMaxOccurrence()); 146 instance.setSelectionMode(template.getSelectionMode()); 147 return instance; 148 } 149 150 /** 151 * factory method to create a deep copy of ChangeTargetMultiBuyCustomLineItemsChangeValue 152 * @param template instance to be copied 153 * @return copy instance 154 */ 155 @Nullable 156 public static ChangeTargetMultiBuyCustomLineItemsChangeValue deepCopy( 157 @Nullable final ChangeTargetMultiBuyCustomLineItemsChangeValue template) { 158 if (template == null) { 159 return null; 160 } 161 ChangeTargetMultiBuyCustomLineItemsChangeValueImpl instance = new ChangeTargetMultiBuyCustomLineItemsChangeValueImpl(); 162 instance.setPredicate(template.getPredicate()); 163 instance.setTriggerQuantity(template.getTriggerQuantity()); 164 instance.setDiscountedQuantity(template.getDiscountedQuantity()); 165 instance.setMaxOccurrence(template.getMaxOccurrence()); 166 instance.setSelectionMode(template.getSelectionMode()); 167 return instance; 168 } 169 170 /** 171 * builder factory method for ChangeTargetMultiBuyCustomLineItemsChangeValue 172 * @return builder 173 */ 174 public static ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder builder() { 175 return ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder.of(); 176 } 177 178 /** 179 * create builder for ChangeTargetMultiBuyCustomLineItemsChangeValue instance 180 * @param template instance with prefilled values for the builder 181 * @return builder 182 */ 183 public static ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder builder( 184 final ChangeTargetMultiBuyCustomLineItemsChangeValue template) { 185 return ChangeTargetMultiBuyCustomLineItemsChangeValueBuilder.of(template); 186 } 187 188 /** 189 * accessor map function 190 * @param <T> mapped type 191 * @param helper function to map the object 192 * @return mapped value 193 */ 194 default <T> T withChangeTargetMultiBuyCustomLineItemsChangeValue( 195 Function<ChangeTargetMultiBuyCustomLineItemsChangeValue, T> helper) { 196 return helper.apply(this); 197 } 198 199 /** 200 * gives a TypeReference for usage with Jackson DataBind 201 * @return TypeReference 202 */ 203 public static com.fasterxml.jackson.core.type.TypeReference<ChangeTargetMultiBuyCustomLineItemsChangeValue> typeReference() { 204 return new com.fasterxml.jackson.core.type.TypeReference<ChangeTargetMultiBuyCustomLineItemsChangeValue>() { 205 @Override 206 public String toString() { 207 return "TypeReference<ChangeTargetMultiBuyCustomLineItemsChangeValue>"; 208 } 209 }; 210 } 211}