Class DiscountedLineItemPortionBuilder
java.lang.Object
com.commercetools.importapi.models.orders.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
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds DiscountedLineItemPortion with checking for non-null required valuesbuilds DiscountedLineItemPortion without checking for non-null required valuesdiscount
(CartDiscountKeyReference discount) References a cart discount by key.References a cart discount by key.discountedAmount
(Money discountedAmount) set the value to the discountedAmountdiscountedAmount
(Function<MoneyBuilder, MoneyBuilder> builder) set the value to the discountedAmount using the builder functionReferences a cart discount by key.value of discountedAmount}of()
factory method for an instance of DiscountedLineItemPortionBuilderof
(DiscountedLineItemPortion template) create builder for DiscountedLineItemPortion instanceReferences a cart discount by key.withDiscountedAmount
(Function<MoneyBuilder, Money> builder) set the value to the discountedAmount using the builder function
-
Constructor Details
-
DiscountedLineItemPortionBuilder
public DiscountedLineItemPortionBuilder()
-
-
Method Details
-
discount
public DiscountedLineItemPortionBuilder discount(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReferenceBuilder> builder) References a cart discount by key.
- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
withDiscount
public DiscountedLineItemPortionBuilder withDiscount(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReference> builder) References a cart discount by key.
- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
discount
References a cart discount by key.
- Parameters:
discount
- value to be set- Returns:
- Builder
-
discountedAmount
public DiscountedLineItemPortionBuilder discountedAmount(Function<MoneyBuilder, MoneyBuilder> builder) set the value to the discountedAmount using the builder function- Parameters:
builder
- function to build the discountedAmount value- Returns:
- Builder
-
withDiscountedAmount
set the value to the discountedAmount using the builder function- Parameters:
builder
- function to build the discountedAmount value- Returns:
- Builder
-
discountedAmount
set the value to the discountedAmount- Parameters:
discountedAmount
- value to be set- Returns:
- Builder
-
getDiscount
References a cart discount by key.
- Returns:
- discount
-
getDiscountedAmount
value of discountedAmount}- Returns:
- discountedAmount
-
build
builds DiscountedLineItemPortion with checking for non-null required values- Specified by:
build
in 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
-