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