Class MultiBuyLineItemsTargetBuilder
- All Implemented Interfaces:
Builder<MultiBuyLineItemsTarget>
Example to create an instance using the builder pattern
MultiBuyLineItemsTarget multiBuyLineItemsTarget = MultiBuyLineItemsTarget.builder()
.predicate("{predicate}")
.triggerQuantity(1)
.discountedQuantity(1)
.selectionMode(SelectionMode.CHEAPEST)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds MultiBuyLineItemsTarget with checking for non-null required valuesbuilds MultiBuyLineItemsTarget without checking for non-null required valuesdiscountedQuantity
(Integer discountedQuantity) Number of Line Items that are discounted per application of this Discount.Number of Line Items that are discounted per application of this Discount.Maximum number of times this Discount can be applied.Valid LineItem target predicate.Discounts particular Line Items only according to the SelectionMode.Number of Line Items to be present in order to trigger an application of this Discount.maxOccurrence
(Integer maxOccurrence) Maximum number of times this Discount can be applied.of()
factory method for an instance of MultiBuyLineItemsTargetBuilderof
(MultiBuyLineItemsTarget template) create builder for MultiBuyLineItemsTarget instanceValid LineItem target predicate.selectionMode
(SelectionMode selectionMode) Discounts particular Line Items only according to the SelectionMode.triggerQuantity
(Integer triggerQuantity) Number of Line Items to be present in order to trigger an application of this Discount.
-
Constructor Details
-
MultiBuyLineItemsTargetBuilder
public MultiBuyLineItemsTargetBuilder()
-
-
Method Details
-
predicate
Valid LineItem target predicate. The Discount will be applied to Line Items that are matched by the predicate.
- Parameters:
predicate
- value to be set- Returns:
- Builder
-
triggerQuantity
Number of Line Items to be present in order to trigger an application of this Discount.
- Parameters:
triggerQuantity
- value to be set- Returns:
- Builder
-
discountedQuantity
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- Returns:
- Builder
-
maxOccurrence
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- Returns:
- Builder
-
selectionMode
Discounts particular Line Items only according to the SelectionMode.
- Parameters:
selectionMode
- value to be set- Returns:
- Builder
-
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
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
-
build
builds MultiBuyLineItemsTarget with checking for non-null required values- Specified by:
build
in interfaceBuilder<MultiBuyLineItemsTarget>
- Returns:
- MultiBuyLineItemsTarget
-
buildUnchecked
builds MultiBuyLineItemsTarget without checking for non-null required values- Returns:
- MultiBuyLineItemsTarget
-
of
factory method for an instance of MultiBuyLineItemsTargetBuilder- Returns:
- builder
-
of
create builder for MultiBuyLineItemsTarget instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-