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 valuesdiscount
(CartDiscountReference discount) Cart Discount related to the discounted price.Cart Discount related to the discounted price.discountedAmount
(TypedMoney discountedAmount) Money value of the discount.discountedAmount
(Function<TypedMoneyBuilder, Builder<? extends TypedMoney>> builder) Money value of the discount.Cart Discount related to the discounted price.Money value of the discount.of()
factory method for an instance of DiscountedTotalPricePortionBuilderof
(DiscountedTotalPricePortion template) create builder for DiscountedTotalPricePortion instanceCart Discount related to the discounted price.
-
Constructor Details
-
DiscountedTotalPricePortionBuilder
public DiscountedTotalPricePortionBuilder()
-
-
Method Details
-
discount
public DiscountedTotalPricePortionBuilder discount(Function<CartDiscountReferenceBuilder, CartDiscountReferenceBuilder> builder) Cart Discount related to the discounted price.
- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
withDiscount
public DiscountedTotalPricePortionBuilder withDiscount(Function<CartDiscountReferenceBuilder, CartDiscountReference> builder) Cart Discount related to the discounted price.
- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
discount
Cart Discount related to the discounted price.
- Parameters:
discount
- value to be set- 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
Cart Discount related to the discounted price.
- 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
-