Class DiscountedLineItemPriceBuilder
java.lang.Object
com.commercetools.api.models.cart.DiscountedLineItemPriceBuilder
- All Implemented Interfaces:
Builder<DiscountedLineItemPrice>
public class DiscountedLineItemPriceBuilder
extends Object
implements Builder<DiscountedLineItemPrice>
DiscountedLineItemPriceBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DiscountedLineItemPrice discountedLineItemPrice = DiscountedLineItemPrice.builder()
.value(valueBuilder -> valueBuilder)
.plusIncludedDiscounts(includedDiscountsBuilder -> includedDiscountsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDiscount applicable on the Line Item or Custom Line Item.build()
builds DiscountedLineItemPrice with checking for non-null required valuesbuilds DiscountedLineItemPrice without checking for non-null required valuesDiscount applicable on the Line Item or Custom Line Item.getValue()
Money value of the discounted Line Item or Custom Line Item.includedDiscounts
(DiscountedLineItemPortion... includedDiscounts) Discount applicable on the Line Item or Custom Line Item.includedDiscounts
(List<DiscountedLineItemPortion> includedDiscounts) Discount applicable on the Line Item or Custom Line Item.of()
factory method for an instance of DiscountedLineItemPriceBuilderof
(DiscountedLineItemPrice template) create builder for DiscountedLineItemPrice instanceplusIncludedDiscounts
(DiscountedLineItemPortion... includedDiscounts) Discount applicable on the Line Item or Custom Line Item.plusIncludedDiscounts
(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortionBuilder> builder) Discount applicable on the Line Item or Custom Line Item.Discount applicable on the Line Item or Custom Line Item.value
(TypedMoney value) Money value of the discounted Line Item or Custom Line Item.value
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discounted Line Item or Custom Line Item.withIncludedDiscounts
(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortionBuilder> builder) Discount applicable on the Line Item or Custom Line Item.
-
Constructor Details
-
DiscountedLineItemPriceBuilder
public DiscountedLineItemPriceBuilder()
-
-
Method Details
-
value
Money value of the discounted Line Item or Custom Line Item.
- Parameters:
value
- value to be set- Returns:
- Builder
-
value
public DiscountedLineItemPriceBuilder value(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discounted Line Item or Custom Line Item.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
includedDiscounts
public DiscountedLineItemPriceBuilder includedDiscounts(DiscountedLineItemPortion... includedDiscounts) Discount applicable on the Line Item or Custom Line Item.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
includedDiscounts
public DiscountedLineItemPriceBuilder includedDiscounts(List<DiscountedLineItemPortion> includedDiscounts) Discount applicable on the Line Item or Custom Line Item.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
plusIncludedDiscounts
public DiscountedLineItemPriceBuilder plusIncludedDiscounts(DiscountedLineItemPortion... includedDiscounts) Discount applicable on the Line Item or Custom Line Item.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
plusIncludedDiscounts
public DiscountedLineItemPriceBuilder plusIncludedDiscounts(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortionBuilder> builder) Discount applicable on the Line Item or Custom Line Item.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
withIncludedDiscounts
public DiscountedLineItemPriceBuilder withIncludedDiscounts(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortionBuilder> builder) Discount applicable on the Line Item or Custom Line Item.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
addIncludedDiscounts
public DiscountedLineItemPriceBuilder addIncludedDiscounts(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortion> builder) Discount applicable on the Line Item or Custom Line Item.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
setIncludedDiscounts
public DiscountedLineItemPriceBuilder setIncludedDiscounts(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortion> builder) Discount applicable on the Line Item or Custom Line Item.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
getValue
Money value of the discounted Line Item or Custom Line Item.
- Returns:
- value
-
getIncludedDiscounts
Discount applicable on the Line Item or Custom Line Item.
- Returns:
- includedDiscounts
-
build
builds DiscountedLineItemPrice with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountedLineItemPrice>
- Returns:
- DiscountedLineItemPrice
-
buildUnchecked
builds DiscountedLineItemPrice without checking for non-null required values- Returns:
- DiscountedLineItemPrice
-
of
factory method for an instance of DiscountedLineItemPriceBuilder- Returns:
- builder
-
of
create builder for DiscountedLineItemPrice instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-