Class DiscountOnTotalPriceBuilder
- All Implemented Interfaces:
Builder<DiscountOnTotalPrice>
Example to create an instance using the builder pattern
DiscountOnTotalPrice discountOnTotalPrice = DiscountOnTotalPrice.builder()
.discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
.plusIncludedDiscounts(includedDiscountsBuilder -> includedDiscountsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddIncludedDiscounts
(Function<DiscountedTotalPricePortionBuilder, DiscountedTotalPricePortion> builder) Discounts that impact the total price of the Cart or Order.build()
builds DiscountOnTotalPrice with checking for non-null required valuesbuilds DiscountOnTotalPrice without checking for non-null required valuesdiscountedAmount
(TypedMoney discountedAmount) Money value of the discount on the total price of the Cart or Order.discountedAmount
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount on the total price of the Cart or Order.discountedGrossAmount
(TypedMoney discountedGrossAmount) Money value of the discount on the total gross price of the Cart or Order.discountedGrossAmount
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount on the total gross price of the Cart or Order.discountedNetAmount
(TypedMoney discountedNetAmount) Money value of the discount on the total net price of the Cart or Order.discountedNetAmount
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount on the total net price of the Cart or Order.Money value of the discount on the total price of the Cart or Order.Money value of the discount on the total gross price of the Cart or Order.Money value of the discount on the total net price of the Cart or Order.Discounts that impact the total price of the Cart or Order.includedDiscounts
(DiscountedTotalPricePortion... includedDiscounts) Discounts that impact the total price of the Cart or Order.includedDiscounts
(List<DiscountedTotalPricePortion> includedDiscounts) Discounts that impact the total price of the Cart or Order.static DiscountOnTotalPriceBuilder
of()
factory method for an instance of DiscountOnTotalPriceBuilderstatic DiscountOnTotalPriceBuilder
of
(DiscountOnTotalPrice template) create builder for DiscountOnTotalPrice instanceplusIncludedDiscounts
(DiscountedTotalPricePortion... includedDiscounts) Discounts that impact the total price of the Cart or Order.plusIncludedDiscounts
(Function<DiscountedTotalPricePortionBuilder, DiscountedTotalPricePortionBuilder> builder) Discounts that impact the total price of the Cart or Order.setIncludedDiscounts
(Function<DiscountedTotalPricePortionBuilder, DiscountedTotalPricePortion> builder) Discounts that impact the total price of the Cart or Order.withIncludedDiscounts
(Function<DiscountedTotalPricePortionBuilder, DiscountedTotalPricePortionBuilder> builder) Discounts that impact the total price of the Cart or Order.
-
Constructor Details
-
DiscountOnTotalPriceBuilder
public DiscountOnTotalPriceBuilder()
-
-
Method Details
-
discountedAmount
Money value of the discount on the total price of the Cart or Order.
- Parameters:
discountedAmount
- value to be set- Returns:
- Builder
-
discountedAmount
public DiscountOnTotalPriceBuilder discountedAmount(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount on the total price of the Cart or Order.
- Parameters:
builder
- function to build the discountedAmount value- Returns:
- Builder
-
includedDiscounts
public DiscountOnTotalPriceBuilder includedDiscounts(DiscountedTotalPricePortion... includedDiscounts) Discounts that impact the total price of the Cart or Order.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
includedDiscounts
public DiscountOnTotalPriceBuilder includedDiscounts(List<DiscountedTotalPricePortion> includedDiscounts) Discounts that impact the total price of the Cart or Order.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
plusIncludedDiscounts
public DiscountOnTotalPriceBuilder plusIncludedDiscounts(DiscountedTotalPricePortion... includedDiscounts) Discounts that impact the total price of the Cart or Order.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
plusIncludedDiscounts
public DiscountOnTotalPriceBuilder plusIncludedDiscounts(Function<DiscountedTotalPricePortionBuilder, DiscountedTotalPricePortionBuilder> builder) Discounts that impact the total price of the Cart or Order.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
withIncludedDiscounts
public DiscountOnTotalPriceBuilder withIncludedDiscounts(Function<DiscountedTotalPricePortionBuilder, DiscountedTotalPricePortionBuilder> builder) Discounts that impact the total price of the Cart or Order.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
addIncludedDiscounts
public DiscountOnTotalPriceBuilder addIncludedDiscounts(Function<DiscountedTotalPricePortionBuilder, DiscountedTotalPricePortion> builder) Discounts that impact the total price of the Cart or Order.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
setIncludedDiscounts
public DiscountOnTotalPriceBuilder setIncludedDiscounts(Function<DiscountedTotalPricePortionBuilder, DiscountedTotalPricePortion> builder) Discounts that impact the total price of the Cart or Order.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
discountedNetAmount
Money value of the discount on the total net price of the Cart or Order. Present only when
taxedPrice
of the Cart or Order exists.- Parameters:
discountedNetAmount
- value to be set- Returns:
- Builder
-
discountedNetAmount
public DiscountOnTotalPriceBuilder discountedNetAmount(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount on the total net price of the Cart or Order. Present only when
taxedPrice
of the Cart or Order exists.- Parameters:
builder
- function to build the discountedNetAmount value- Returns:
- Builder
-
discountedGrossAmount
public DiscountOnTotalPriceBuilder discountedGrossAmount(@Nullable TypedMoney discountedGrossAmount) Money value of the discount on the total gross price of the Cart or Order. Present only when
taxedPrice
of the Cart or Order exists.- Parameters:
discountedGrossAmount
- value to be set- Returns:
- Builder
-
discountedGrossAmount
public DiscountOnTotalPriceBuilder discountedGrossAmount(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount on the total gross price of the Cart or Order. Present only when
taxedPrice
of the Cart or Order exists.- Parameters:
builder
- function to build the discountedGrossAmount value- Returns:
- Builder
-
getDiscountedAmount
Money value of the discount on the total price of the Cart or Order.
- Returns:
- discountedAmount
-
getIncludedDiscounts
Discounts that impact the total price of the Cart or Order.
- Returns:
- includedDiscounts
-
getDiscountedNetAmount
Money value of the discount on the total net price of the Cart or Order. Present only when
taxedPrice
of the Cart or Order exists.- Returns:
- discountedNetAmount
-
getDiscountedGrossAmount
Money value of the discount on the total gross price of the Cart or Order. Present only when
taxedPrice
of the Cart or Order exists.- Returns:
- discountedGrossAmount
-
build
builds DiscountOnTotalPrice with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountOnTotalPrice>
- Returns:
- DiscountOnTotalPrice
-
buildUnchecked
builds DiscountOnTotalPrice without checking for non-null required values- Returns:
- DiscountOnTotalPrice
-
of
factory method for an instance of DiscountOnTotalPriceBuilder- Returns:
- builder
-
of
create builder for DiscountOnTotalPrice instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-