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
Modifier and TypeFieldDescriptionstatic final String
discriminator value for MultiBuyLineItemsTarget -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for MultiBuyLineItemsTargetbuilder
(MultiBuyLineItemsTarget template) create builder for MultiBuyLineItemsTarget instancestatic MultiBuyLineItemsTarget
deepCopy
(MultiBuyLineItemsTarget template) factory method to create a deep copy of MultiBuyLineItemsTarget@NotNull Integer
Number of Line Items that are discounted per application of this Discount.Maximum number of times this Discount can be applied.@NotNull String
Valid LineItem target predicate.@NotNull SelectionMode
Discounts particular Line Items only according to the SelectionMode.@NotNull Integer
Number of Line Items to be present in order to trigger an application of this Discount.static MultiBuyLineItemsTarget
of()
factory methodstatic MultiBuyLineItemsTarget
of
(MultiBuyLineItemsTarget template) factory method to create a shallow copy MultiBuyLineItemsTargetvoid
setDiscountedQuantity
(Integer discountedQuantity) Number of Line Items that are discounted per application of this Discount.void
setMaxOccurrence
(Integer maxOccurrence) Maximum number of times this Discount can be applied.void
setPredicate
(String predicate) Valid LineItem target predicate.void
setSelectionMode
(SelectionMode selectionMode) Discounts particular Line Items only according to the SelectionMode.void
setTriggerQuantity
(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> T
accessor 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
-
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
-