Interface DiscountedLineItemPriceForQuantity
Example to create an instance using the builder pattern
DiscountedLineItemPriceForQuantity discountedLineItemPriceForQuantity = DiscountedLineItemPriceForQuantity.builder()
.quantity(0.3)
.discountedPrice(discountedPriceBuilder -> discountedPriceBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for DiscountedLineItemPriceForQuantitybuilder(DiscountedLineItemPriceForQuantity template) create builder for DiscountedLineItemPriceForQuantity instancecopyDeep()deepCopy(DiscountedLineItemPriceForQuantity template) factory method to create a deep copy of DiscountedLineItemPriceForQuantity@NotNull @Valid DiscountedLineItemPriceDiscounted price of the Line Item or Custom Line Item.@NotNull LongNumber of Line Items or Custom Line Items in the Cart.of()factory methodof(DiscountedLineItemPriceForQuantity template) factory method to create a shallow copy DiscountedLineItemPriceForQuantityvoidsetDiscountedPrice(DiscountedLineItemPrice discountedPrice) Discounted price of the Line Item or Custom Line Item.voidsetQuantity(Long quantity) Number of Line Items or Custom Line Items in the Cart.static com.fasterxml.jackson.core.type.TypeReference<DiscountedLineItemPriceForQuantity>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map function
-
Method Details
-
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
-
setQuantity
Number of Line Items or Custom Line Items in the Cart.
- Parameters:
quantity- value to be set
-
setDiscountedPrice
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
-
of
factory method- Returns:
- instance of DiscountedLineItemPriceForQuantity
-
of
factory method to create a shallow copy DiscountedLineItemPriceForQuantity- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
DiscountedLineItemPriceForQuantity copyDeep() -
deepCopy
@Nullable static DiscountedLineItemPriceForQuantity deepCopy(@Nullable DiscountedLineItemPriceForQuantity template) factory method to create a deep copy of DiscountedLineItemPriceForQuantity- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DiscountedLineItemPriceForQuantity- Returns:
- builder
-
builder
static DiscountedLineItemPriceForQuantityBuilder builder(DiscountedLineItemPriceForQuantity template) create builder for DiscountedLineItemPriceForQuantity instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withDiscountedLineItemPriceForQuantity
default <T> T withDiscountedLineItemPriceForQuantity(Function<DiscountedLineItemPriceForQuantity, T> helper) accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
static com.fasterxml.jackson.core.type.TypeReference<DiscountedLineItemPriceForQuantity> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-