Class DiscountedLineItemPriceForQuantityBuilder
- All Implemented Interfaces:
Builder<DiscountedLineItemPriceForQuantity>
Example to create an instance using the builder pattern
DiscountedLineItemPriceForQuantity discountedLineItemPriceForQuantity = DiscountedLineItemPriceForQuantity.builder()
.quantity(0.3)
.discountedPrice(discountedPriceBuilder -> discountedPriceBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds DiscountedLineItemPriceForQuantity with checking for non-null required valuesbuilds DiscountedLineItemPriceForQuantity without checking for non-null required valuesdiscountedPrice(DiscountedLineItemPrice discountedPrice) Discounted price of the Line Item or Custom Line Item.Discounted price of the Line Item or Custom Line Item.Discounted price of the Line Item or Custom Line Item.Number of Line Items or Custom Line Items in the Cart.of()factory method for an instance of DiscountedLineItemPriceForQuantityBuilderof(DiscountedLineItemPriceForQuantity template) create builder for DiscountedLineItemPriceForQuantity instanceNumber of Line Items or Custom Line Items in the Cart.Discounted price of the Line Item or Custom Line Item.
-
Constructor Details
-
DiscountedLineItemPriceForQuantityBuilder
public DiscountedLineItemPriceForQuantityBuilder()
-
-
Method Details
-
quantity
Number of Line Items or Custom Line Items in the Cart.
- Parameters:
quantity- value to be set- Returns:
- Builder
-
discountedPrice
public DiscountedLineItemPriceForQuantityBuilder discountedPrice(Function<DiscountedLineItemPriceBuilder, DiscountedLineItemPriceBuilder> builder) Discounted price of the Line Item or Custom Line Item.
When multiple Cart Discounts apply to the same Line Item, the discounts are applied sequentially in the order determined by their
sortOrdervalues (higher values are applied first). The price rounding mode specified by the Cart'spriceRoundingModefield is applied after each individual discount is calculated, not after all discounts have been applied cumulatively. This means that rounding occurs at each step of the discount calculation process.- Parameters:
builder- function to build the discountedPrice value- Returns:
- Builder
-
withDiscountedPrice
public DiscountedLineItemPriceForQuantityBuilder withDiscountedPrice(Function<DiscountedLineItemPriceBuilder, DiscountedLineItemPrice> builder) Discounted price of the Line Item or Custom Line Item.
When multiple Cart Discounts apply to the same Line Item, the discounts are applied sequentially in the order determined by their
sortOrdervalues (higher values are applied first). The price rounding mode specified by the Cart'spriceRoundingModefield is applied after each individual discount is calculated, not after all discounts have been applied cumulatively. This means that rounding occurs at each step of the discount calculation process.- Parameters:
builder- function to build the discountedPrice value- Returns:
- Builder
-
discountedPrice
public DiscountedLineItemPriceForQuantityBuilder discountedPrice(DiscountedLineItemPrice discountedPrice) Discounted price of the Line Item or Custom Line Item.
When multiple Cart Discounts apply to the same Line Item, the discounts are applied sequentially in the order determined by their
sortOrdervalues (higher values are applied first). The price rounding mode specified by the Cart'spriceRoundingModefield is applied after each individual discount is calculated, not after all discounts have been applied cumulatively. This means that rounding occurs at each step of the discount calculation process.- Parameters:
discountedPrice- value to be set- Returns:
- Builder
-
getQuantity
Number of Line Items or Custom Line Items in the Cart.
- Returns:
- quantity
-
getDiscountedPrice
Discounted price of the Line Item or Custom Line Item.
When multiple Cart Discounts apply to the same Line Item, the discounts are applied sequentially in the order determined by their
sortOrdervalues (higher values are applied first). The price rounding mode specified by the Cart'spriceRoundingModefield is applied after each individual discount is calculated, not after all discounts have been applied cumulatively. This means that rounding occurs at each step of the discount calculation process.- Returns:
- discountedPrice
-
build
builds DiscountedLineItemPriceForQuantity with checking for non-null required values- Specified by:
buildin interfaceBuilder<DiscountedLineItemPriceForQuantity>- Returns:
- DiscountedLineItemPriceForQuantity
-
buildUnchecked
builds DiscountedLineItemPriceForQuantity without checking for non-null required values- Returns:
- DiscountedLineItemPriceForQuantity
-
of
factory method for an instance of DiscountedLineItemPriceForQuantityBuilder- Returns:
- builder
-
of
public static DiscountedLineItemPriceForQuantityBuilder of(DiscountedLineItemPriceForQuantity template) create builder for DiscountedLineItemPriceForQuantity instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-