Class ChangeTargetPatternChangeValueBuilder
- All Implemented Interfaces:
Builder<ChangeTargetPatternChangeValue>
Example to create an instance using the builder pattern
ChangeTargetPatternChangeValue changeTargetPatternChangeValue = ChangeTargetPatternChangeValue.builder()
.plusTargetPattern(targetPatternBuilder -> targetPatternBuilder)
.selectionMode(SelectionMode.CHEAPEST)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ChangeTargetPatternChangeValue with checking for non-null required valuesbuilds ChangeTargetPatternChangeValue without checking for non-null required valuesMaximum number of times the Discount applies on a Cart.Indicates which of the matching units of (Custom) Line Items were discounted.Units of (Custom) Line Items on which the Discount is applied.Units of a (Custom) Line Item that triggered the discount application.maxOccurrence
(Integer maxOccurrence) Maximum number of times the Discount applies on a Cart.of()
factory method for an instance of ChangeTargetPatternChangeValueBuilderof
(ChangeTargetPatternChangeValue template) create builder for ChangeTargetPatternChangeValue instanceplusTargetPattern
(PatternComponent... targetPattern) Units of (Custom) Line Items on which the Discount is applied.plusTargetPattern
(Function<PatternComponentBuilder, Builder<? extends PatternComponent>> builder) Units of (Custom) Line Items on which the Discount is applied.plusTriggerPattern
(PatternComponent... triggerPattern) Units of a (Custom) Line Item that triggered the discount application.plusTriggerPattern
(Function<PatternComponentBuilder, Builder<? extends PatternComponent>> builder) Units of a (Custom) Line Item that triggered the discount application.selectionMode
(SelectionMode selectionMode) Indicates which of the matching units of (Custom) Line Items were discounted.targetPattern
(PatternComponent... targetPattern) Units of (Custom) Line Items on which the Discount is applied.targetPattern
(List<PatternComponent> targetPattern) Units of (Custom) Line Items on which the Discount is applied.triggerPattern
(PatternComponent... triggerPattern) Units of a (Custom) Line Item that triggered the discount application.triggerPattern
(List<PatternComponent> triggerPattern) Units of a (Custom) Line Item that triggered the discount application.withTargetPattern
(Function<PatternComponentBuilder, Builder<? extends PatternComponent>> builder) Units of (Custom) Line Items on which the Discount is applied.withTriggerPattern
(Function<PatternComponentBuilder, Builder<? extends PatternComponent>> builder) Units of a (Custom) Line Item that triggered the discount application.
-
Constructor Details
-
ChangeTargetPatternChangeValueBuilder
public ChangeTargetPatternChangeValueBuilder()
-
-
Method Details
-
triggerPattern
public ChangeTargetPatternChangeValueBuilder triggerPattern(@Nullable PatternComponent... triggerPattern) Units of a (Custom) Line Item that triggered the discount application.
- Parameters:
triggerPattern
- value to be set- Returns:
- Builder
-
triggerPattern
public ChangeTargetPatternChangeValueBuilder triggerPattern(@Nullable List<PatternComponent> triggerPattern) Units of a (Custom) Line Item that triggered the discount application.
- Parameters:
triggerPattern
- value to be set- Returns:
- Builder
-
plusTriggerPattern
public ChangeTargetPatternChangeValueBuilder plusTriggerPattern(@Nullable PatternComponent... triggerPattern) Units of a (Custom) Line Item that triggered the discount application.
- Parameters:
triggerPattern
- value to be set- Returns:
- Builder
-
plusTriggerPattern
public ChangeTargetPatternChangeValueBuilder plusTriggerPattern(Function<PatternComponentBuilder, Builder<? extends PatternComponent>> builder) Units of a (Custom) Line Item that triggered the discount application.
- Parameters:
builder
- function to build the triggerPattern value- Returns:
- Builder
-
withTriggerPattern
public ChangeTargetPatternChangeValueBuilder withTriggerPattern(Function<PatternComponentBuilder, Builder<? extends PatternComponent>> builder) Units of a (Custom) Line Item that triggered the discount application.
- Parameters:
builder
- function to build the triggerPattern value- Returns:
- Builder
-
targetPattern
Units of (Custom) Line Items on which the Discount is applied.
- Parameters:
targetPattern
- value to be set- Returns:
- Builder
-
targetPattern
Units of (Custom) Line Items on which the Discount is applied.
- Parameters:
targetPattern
- value to be set- Returns:
- Builder
-
plusTargetPattern
Units of (Custom) Line Items on which the Discount is applied.
- Parameters:
targetPattern
- value to be set- Returns:
- Builder
-
plusTargetPattern
public ChangeTargetPatternChangeValueBuilder plusTargetPattern(Function<PatternComponentBuilder, Builder<? extends PatternComponent>> builder) Units of (Custom) Line Items on which the Discount is applied.
- Parameters:
builder
- function to build the targetPattern value- Returns:
- Builder
-
withTargetPattern
public ChangeTargetPatternChangeValueBuilder withTargetPattern(Function<PatternComponentBuilder, Builder<? extends PatternComponent>> builder) Units of (Custom) Line Items on which the Discount is applied.
- Parameters:
builder
- function to build the targetPattern value- Returns:
- Builder
-
maxOccurrence
Maximum number of times the Discount applies on a Cart.
If empty, the Discount applies indefinitely.
- Parameters:
maxOccurrence
- value to be set- Returns:
- Builder
-
selectionMode
Indicates which of the matching units of (Custom) Line Items were discounted.
- Parameters:
selectionMode
- value to be set- Returns:
- Builder
-
getTriggerPattern
Units of a (Custom) Line Item that triggered the discount application.
- Returns:
- triggerPattern
-
getTargetPattern
Units of (Custom) Line Items on which the Discount is applied.
- Returns:
- targetPattern
-
getMaxOccurrence
Maximum number of times the Discount applies on a Cart.
If empty, the Discount applies indefinitely.
- Returns:
- maxOccurrence
-
getSelectionMode
Indicates which of the matching units of (Custom) Line Items were discounted.
- Returns:
- selectionMode
-
build
builds ChangeTargetPatternChangeValue with checking for non-null required values- Specified by:
build
in interfaceBuilder<ChangeTargetPatternChangeValue>
- Returns:
- ChangeTargetPatternChangeValue
-
buildUnchecked
builds ChangeTargetPatternChangeValue without checking for non-null required values- Returns:
- ChangeTargetPatternChangeValue
-
of
factory method for an instance of ChangeTargetPatternChangeValueBuilder- Returns:
- builder
-
of
create builder for ChangeTargetPatternChangeValue instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-