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