Class DiscountedLineItemPortionBuilder
- All Implemented Interfaces:
Builder<DiscountedLineItemPortion>
Example to create an instance using the builder pattern
DiscountedLineItemPortion discountedLineItemPortion = DiscountedLineItemPortion.builder()
.discount(discountBuilder -> discountBuilder)
.discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds DiscountedLineItemPortion with checking for non-null required valuesbuilds DiscountedLineItemPortion without checking for non-null required valuesdiscount
(CartDiscountKeyReference discount) References a cart discount by key.References a cart discount by key.discountedAmount
(Money discountedAmount) Money value for the discount applicable.discountedAmount
(Function<MoneyBuilder, MoneyBuilder> builder) Money value for the discount applicable.References a cart discount by key.Money value for the discount applicable.of()
factory method for an instance of DiscountedLineItemPortionBuilderof
(DiscountedLineItemPortion template) create builder for DiscountedLineItemPortion instanceReferences a cart discount by key.withDiscountedAmount
(Function<MoneyBuilder, Money> builder) Money value for the discount applicable.
-
Constructor Details
-
DiscountedLineItemPortionBuilder
public DiscountedLineItemPortionBuilder()
-
-
Method Details
-
discount
public DiscountedLineItemPortionBuilder discount(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReferenceBuilder> builder) References a cart discount by key. If the referenced CartDiscount does not exist, the
state
of the ImportOperation will be set tounresolved
until the referenced CartDiscount is created.- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
withDiscount
public DiscountedLineItemPortionBuilder withDiscount(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReference> builder) References a cart discount by key. If the referenced CartDiscount does not exist, the
state
of the ImportOperation will be set tounresolved
until the referenced CartDiscount is created.- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
discount
References a cart discount by key. If the referenced CartDiscount does not exist, the
state
of the ImportOperation will be set tounresolved
until the referenced CartDiscount is created.- Parameters:
discount
- value to be set- Returns:
- Builder
-
discountedAmount
public DiscountedLineItemPortionBuilder discountedAmount(Function<MoneyBuilder, MoneyBuilder> builder) Money value for the discount applicable.
- Parameters:
builder
- function to build the discountedAmount value- Returns:
- Builder
-
withDiscountedAmount
Money value for the discount applicable.
- Parameters:
builder
- function to build the discountedAmount value- Returns:
- Builder
-
discountedAmount
Money value for the discount applicable.
- Parameters:
discountedAmount
- value to be set- Returns:
- Builder
-
getDiscount
References a cart discount by key. If the referenced CartDiscount does not exist, the
state
of the ImportOperation will be set tounresolved
until the referenced CartDiscount is created.- Returns:
- discount
-
getDiscountedAmount
Money value for the discount applicable.
- Returns:
- discountedAmount
-
build
builds DiscountedLineItemPortion with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountedLineItemPortion>
- Returns:
- DiscountedLineItemPortion
-
buildUnchecked
builds DiscountedLineItemPortion without checking for non-null required values- Returns:
- DiscountedLineItemPortion
-
of
factory method for an instance of DiscountedLineItemPortionBuilder- Returns:
- builder
-
of
create builder for DiscountedLineItemPortion instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-