Interface MultiBuyCustomLineItemsTarget
- All Superinterfaces:
CartDiscountTarget
- All Known Implementing Classes:
MultiBuyCustomLineItemsTargetImpl
This Discount target is similar to MultiBuyLineItems
, but is applied on Custom Line Items instead of Line Items.
Example to create an instance using the builder pattern
MultiBuyCustomLineItemsTarget multiBuyCustomLineItemsTarget = MultiBuyCustomLineItemsTarget.builder()
.predicate("{predicate}")
.triggerQuantity(1)
.discountedQuantity(1)
.selectionMode(SelectionMode.CHEAPEST)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for MultiBuyCustomLineItemsTarget -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for MultiBuyCustomLineItemsTargetbuilder
(MultiBuyCustomLineItemsTarget template) create builder for MultiBuyCustomLineItemsTarget instancedeepCopy
(MultiBuyCustomLineItemsTarget template) factory method to create a deep copy of MultiBuyCustomLineItemsTarget@NotNull Integer
Number of Custom Line Items that are discounted per application of this Discount.Maximum number of times this Discount can be applied.@NotNull String
Valid CustomLineItems target predicate.@NotNull SelectionMode
Discounts particular Line Items only according to the SelectionMode.@NotNull Integer
Number of Custom Line Items to be present in order to trigger an application of this Discount.of()
factory methodof
(MultiBuyCustomLineItemsTarget template) factory method to create a shallow copy MultiBuyCustomLineItemsTargetvoid
setDiscountedQuantity
(Integer discountedQuantity) Number of Custom 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 CustomLineItems target predicate.void
setSelectionMode
(SelectionMode selectionMode) Discounts particular Line Items only according to the SelectionMode.void
setTriggerQuantity
(Integer triggerQuantity) Number of Custom Line Items to be present in order to trigger an application of this Discount.static com.fasterxml.jackson.core.type.TypeReference<MultiBuyCustomLineItemsTarget>
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_CUSTOM_LINE_ITEMS
discriminator value for MultiBuyCustomLineItemsTarget- See Also:
-
-
Method Details
-
getPredicate
Valid CustomLineItems target predicate. The Discount will be applied to Custom Line Items that are matched by the predicate.
- Returns:
- predicate
-
getTriggerQuantity
Number of Custom Line Items to be present in order to trigger an application of this Discount.
- Returns:
- triggerQuantity
-
getDiscountedQuantity
Number of Custom 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 CustomLineItems target predicate. The Discount will be applied to Custom Line Items that are matched by the predicate.
- Parameters:
predicate
- value to be set
-
setTriggerQuantity
Number of Custom Line Items to be present in order to trigger an application of this Discount.
- Parameters:
triggerQuantity
- value to be set
-
setDiscountedQuantity
Number of Custom 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 MultiBuyCustomLineItemsTarget
-
of
factory method to create a shallow copy MultiBuyCustomLineItemsTarget- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static MultiBuyCustomLineItemsTarget deepCopy(@Nullable MultiBuyCustomLineItemsTarget template) factory method to create a deep copy of MultiBuyCustomLineItemsTarget- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for MultiBuyCustomLineItemsTarget- Returns:
- builder
-
builder
create builder for MultiBuyCustomLineItemsTarget instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withMultiBuyCustomLineItemsTarget
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
-