Class DiscountedLineItemPortionBuilder
java.lang.Object
com.commercetools.api.models.cart.DiscountedLineItemPortionBuilder
- All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<DiscountedLineItemPortion>
public class DiscountedLineItemPortionBuilder
extends Object
implements io.vrap.rmf.base.client.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
-
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 for the applicable discount on the Line Item.discount
(Function<ReferenceBuilder, io.vrap.rmf.base.client.Builder<? extends Reference>> builder) A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.discountedAmount
(TypedMoney discountedAmount) Money value of the discount applicable.discountedAmount
(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Money value of the discount applicable.A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.Money value of the discount applicable.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 for the applicable discount on the Line Item.
- Parameters:
discount
- value to be set- Returns:
- Builder
-
discount
public DiscountedLineItemPortionBuilder discount(Function<ReferenceBuilder, io.vrap.rmf.base.client.Builder<? extends Reference>> builder) A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.
- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
discountedAmount
Money value of the discount applicable.
- Parameters:
discountedAmount
- value to be set- Returns:
- Builder
-
discountedAmount
public DiscountedLineItemPortionBuilder discountedAmount(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Money value of the discount applicable.
- Parameters:
builder
- function to build the discountedAmount value- Returns:
- Builder
-
getDiscount
A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.
- Returns:
- discount
-
getDiscountedAmount
Money value of the discount applicable.
- Returns:
- discountedAmount
-
build
builds DiscountedLineItemPortion with checking for non-null required values- Specified by:
build
in interfaceio.vrap.rmf.base.client.Builder<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
-