Interface DiscountedLineItemPrice
Example to create an instance using the builder pattern
DiscountedLineItemPrice discountedLineItemPrice = DiscountedLineItemPrice.builder()
.value(valueBuilder -> valueBuilder)
.plusIncludedDiscounts(includedDiscountsBuilder -> includedDiscountsBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for DiscountedLineItemPricebuilder(DiscountedLineItemPrice template) create builder for DiscountedLineItemPrice instancecopyDeep()static DiscountedLineItemPricedeepCopy(DiscountedLineItemPrice template) factory method to create a deep copy of DiscountedLineItemPrice@NotNull @Valid List<DiscountedLineItemPortion>Discount applicable on the Line Item or Custom Line Item.@NotNull @Valid TypedMoneygetValue()Money value of the discounted Line Item or Custom Line Item.static DiscountedLineItemPriceof()factory methodstatic DiscountedLineItemPriceof(DiscountedLineItemPrice template) factory method to create a shallow copy DiscountedLineItemPricevoidsetIncludedDiscounts(DiscountedLineItemPortion... includedDiscounts) Discount applicable on the Line Item or Custom Line Item.voidsetIncludedDiscounts(List<DiscountedLineItemPortion> includedDiscounts) Discount applicable on the Line Item or Custom Line Item.voidsetValue(TypedMoney value) Money value of the discounted Line Item or Custom Line Item.static com.fasterxml.jackson.core.type.TypeReference<DiscountedLineItemPrice>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map function
-
Method Details
-
getValue
Money value of the discounted Line Item or Custom Line Item.
When multiple discounts from
includedDiscountsapply, they are applied sequentially based on thesortOrderof their associated Cart Discounts (discounts with highersortOrdervalues are applied first). The Cart'spriceRoundingModefield (RoundingMode) is applied after each discount calculation, so rounding occurs after each discount step rather than only once on the final cumulative amount.- Returns:
- value
-
getIncludedDiscounts
Discount applicable on the Line Item or Custom Line Item.
- Returns:
- includedDiscounts
-
setValue
Money value of the discounted Line Item or Custom Line Item.
When multiple discounts from
includedDiscountsapply, they are applied sequentially based on thesortOrderof their associated Cart Discounts (discounts with highersortOrdervalues are applied first). The Cart'spriceRoundingModefield (RoundingMode) is applied after each discount calculation, so rounding occurs after each discount step rather than only once on the final cumulative amount.- Parameters:
value- value to be set
-
setIncludedDiscounts
Discount applicable on the Line Item or Custom Line Item.
- Parameters:
includedDiscounts- values to be set
-
setIncludedDiscounts
Discount applicable on the Line Item or Custom Line Item.
- Parameters:
includedDiscounts- values to be set
-
of
factory method- Returns:
- instance of DiscountedLineItemPrice
-
of
factory method to create a shallow copy DiscountedLineItemPrice- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
DiscountedLineItemPrice copyDeep() -
deepCopy
factory method to create a deep copy of DiscountedLineItemPrice- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DiscountedLineItemPrice- Returns:
- builder
-
builder
create builder for DiscountedLineItemPrice instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withDiscountedLineItemPrice
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-