Class DiscountedTotalPricePortionBuilder
java.lang.Object
com.commercetools.api.models.cart.DiscountedTotalPricePortionBuilder
- All Implemented Interfaces:
Builder<DiscountedTotalPricePortion>
public class DiscountedTotalPricePortionBuilder
extends Object
implements Builder<DiscountedTotalPricePortion>
DiscountedTotalPricePortionBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DiscountedTotalPricePortion discountedTotalPricePortion = DiscountedTotalPricePortion.builder()
.discount(discountBuilder -> discountBuilder)
.discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds DiscountedTotalPricePortion with checking for non-null required valuesbuilds DiscountedTotalPricePortion without checking for non-null required valuesA CartDiscountReference or DirectDiscountReference to the discount applied on the CarttotalPrice
.discount
(Function<ReferenceBuilder, Builder<? extends Reference>> builder) A CartDiscountReference or DirectDiscountReference to the discount applied on the CarttotalPrice
.discountedAmount
(TypedMoney discountedAmount) Money value of the discount.discountedAmount
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount.A CartDiscountReference or DirectDiscountReference to the discount applied on the CarttotalPrice
.Money value of the discount.of()
factory method for an instance of DiscountedTotalPricePortionBuilderof
(DiscountedTotalPricePortion template) create builder for DiscountedTotalPricePortion instance
-
Constructor Details
-
DiscountedTotalPricePortionBuilder
public DiscountedTotalPricePortionBuilder()
-
-
Method Details
-
discount
A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart
totalPrice
.- Parameters:
discount
- value to be set- Returns:
- Builder
-
discount
public DiscountedTotalPricePortionBuilder discount(Function<ReferenceBuilder, Builder<? extends Reference>> builder) A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart
totalPrice
.- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
discountedAmount
Money value of the discount.
- Parameters:
discountedAmount
- value to be set- Returns:
- Builder
-
discountedAmount
public DiscountedTotalPricePortionBuilder discountedAmount(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount.
- Parameters:
builder
- function to build the discountedAmount value- Returns:
- Builder
-
getDiscount
A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart
totalPrice
.- Returns:
- discount
-
getDiscountedAmount
Money value of the discount.
- Returns:
- discountedAmount
-
build
builds DiscountedTotalPricePortion with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountedTotalPricePortion>
- Returns:
- DiscountedTotalPricePortion
-
buildUnchecked
builds DiscountedTotalPricePortion without checking for non-null required values- Returns:
- DiscountedTotalPricePortion
-
of
factory method for an instance of DiscountedTotalPricePortionBuilder- Returns:
- builder
-
of
create builder for DiscountedTotalPricePortion instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-