Interface MultiBuyLineItemsTarget
- All Superinterfaces:
CartDiscountTarget
Example to create an instance using the builder pattern
MultiBuyLineItemsTarget multiBuyLineItemsTarget = MultiBuyLineItemsTarget.builder()
.predicate("{predicate}")
.triggerQuantity(1)
.discountedQuantity(1)
.selectionMode(SelectionMode.CHEAPEST)
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for MultiBuyLineItemsTarget -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for MultiBuyLineItemsTargetbuilder(MultiBuyLineItemsTarget template) create builder for MultiBuyLineItemsTarget instancecopyDeep()static MultiBuyLineItemsTargetdeepCopy(MultiBuyLineItemsTarget template) factory method to create a deep copy of MultiBuyLineItemsTarget@NotNull IntegerNumber of Line Items that are discounted per application of this Discount.Maximum number of times this Discount can be applied.@NotNull StringValid LineItem target predicate.@NotNull SelectionModeDiscounts particular Line Items only according to the SelectionMode.@NotNull IntegerNumber of Line Items to be present in order to trigger an application of this Discount.static MultiBuyLineItemsTargetof()factory methodstatic MultiBuyLineItemsTargetof(MultiBuyLineItemsTarget template) factory method to create a shallow copy MultiBuyLineItemsTargetvoidsetDiscountedQuantity(Integer discountedQuantity) Number of Line Items that are discounted per application of this Discount.voidsetMaxOccurrence(Integer maxOccurrence) Maximum number of times this Discount can be applied.voidsetPredicate(String predicate) Valid LineItem target predicate.voidsetSelectionMode(SelectionMode selectionMode) Discounts particular Line Items only according to the SelectionMode.voidsetTriggerQuantity(Integer triggerQuantity) Number of Line Items to be present in order to trigger an application of this Discount.static com.fasterxml.jackson.core.type.TypeReference<MultiBuyLineItemsTarget>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.cart_discount.CartDiscountTarget
getType, withCartDiscountTarget
-
Field Details
-
MULTI_BUY_LINE_ITEMS
discriminator value for MultiBuyLineItemsTarget- See Also:
-
-
Method Details
-
getPredicate
Valid LineItem target predicate. The Discount will be applied to Line Items that are matched by the predicate.
- Returns:
- predicate
-
getTriggerQuantity
Number of Line Items to be present in order to trigger an application of this Discount.
- Returns:
- triggerQuantity
-
getDiscountedQuantity
Number of Line Items that are discounted per application of this Discount. It must be less than or equal to the
triggerQuantity.- Returns:
- discountedQuantity
-
getMaxOccurrence
Integer getMaxOccurrence()Maximum number of times this Discount can be applied. Do not set if the Discount should be applied an unlimited number of times.
- Returns:
- maxOccurrence
-
getSelectionMode
Discounts particular Line Items only according to the SelectionMode.
- Returns:
- selectionMode
-
setPredicate
Valid LineItem target predicate. The Discount will be applied to Line Items that are matched by the predicate.
- Parameters:
predicate- value to be set
-
setTriggerQuantity
Number of Line Items to be present in order to trigger an application of this Discount.
- Parameters:
triggerQuantity- value to be set
-
setDiscountedQuantity
Number of Line Items that are discounted per application of this Discount. It must be less than or equal to the
triggerQuantity.- Parameters:
discountedQuantity- value to be set
-
setMaxOccurrence
Maximum number of times this Discount can be applied. Do not set if the Discount should be applied an unlimited number of times.
- Parameters:
maxOccurrence- value to be set
-
setSelectionMode
Discounts particular Line Items only according to the SelectionMode.
- Parameters:
selectionMode- value to be set
-
of
factory method- Returns:
- instance of MultiBuyLineItemsTarget
-
of
factory method to create a shallow copy MultiBuyLineItemsTarget- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
MultiBuyLineItemsTarget copyDeep()- Specified by:
copyDeepin interfaceCartDiscountTarget
-
deepCopy
factory method to create a deep copy of MultiBuyLineItemsTarget- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for MultiBuyLineItemsTarget- Returns:
- builder
-
builder
create builder for MultiBuyLineItemsTarget instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withMultiBuyLineItemsTarget
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-