Class DiscountedLineItemPriceDraftBuilder
java.lang.Object
com.commercetools.api.models.order.DiscountedLineItemPriceDraftBuilder
- All Implemented Interfaces:
Builder<DiscountedLineItemPriceDraft>
public class DiscountedLineItemPriceDraftBuilder
extends Object
implements Builder<DiscountedLineItemPriceDraft>
DiscountedLineItemPriceDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DiscountedLineItemPriceDraft discountedLineItemPriceDraft = DiscountedLineItemPriceDraft.builder()
.value(valueBuilder -> valueBuilder)
.plusIncludedDiscounts(includedDiscountsBuilder -> includedDiscountsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddIncludedDiscounts
(Function<DiscountedLineItemPortionDraftBuilder, DiscountedLineItemPortionDraft> builder) Discounts to be applied.build()
builds DiscountedLineItemPriceDraft with checking for non-null required valuesbuilds DiscountedLineItemPriceDraft without checking for non-null required valuesDiscounts to be applied.getValue()
Discounted money value.includedDiscounts
(DiscountedLineItemPortionDraft... includedDiscounts) Discounts to be applied.includedDiscounts
(List<DiscountedLineItemPortionDraft> includedDiscounts) Discounts to be applied.of()
factory method for an instance of DiscountedLineItemPriceDraftBuilderof
(DiscountedLineItemPriceDraft template) create builder for DiscountedLineItemPriceDraft instanceplusIncludedDiscounts
(DiscountedLineItemPortionDraft... includedDiscounts) Discounts to be applied.plusIncludedDiscounts
(Function<DiscountedLineItemPortionDraftBuilder, DiscountedLineItemPortionDraftBuilder> builder) Discounts to be applied.setIncludedDiscounts
(Function<DiscountedLineItemPortionDraftBuilder, DiscountedLineItemPortionDraft> builder) Discounts to be applied.Discounted money value.value
(Function<MoneyBuilder, MoneyBuilder> builder) Discounted money value.withIncludedDiscounts
(Function<DiscountedLineItemPortionDraftBuilder, DiscountedLineItemPortionDraftBuilder> builder) Discounts to be applied.withValue
(Function<MoneyBuilder, Money> builder) Discounted money value.
-
Constructor Details
-
DiscountedLineItemPriceDraftBuilder
public DiscountedLineItemPriceDraftBuilder()
-
-
Method Details
-
value
Discounted money value.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
withValue
Discounted money value.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
value
Discounted money value.
- Parameters:
value
- value to be set- Returns:
- Builder
-
includedDiscounts
public DiscountedLineItemPriceDraftBuilder includedDiscounts(DiscountedLineItemPortionDraft... includedDiscounts) Discounts to be applied.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
includedDiscounts
public DiscountedLineItemPriceDraftBuilder includedDiscounts(List<DiscountedLineItemPortionDraft> includedDiscounts) Discounts to be applied.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
plusIncludedDiscounts
public DiscountedLineItemPriceDraftBuilder plusIncludedDiscounts(DiscountedLineItemPortionDraft... includedDiscounts) Discounts to be applied.
- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
plusIncludedDiscounts
public DiscountedLineItemPriceDraftBuilder plusIncludedDiscounts(Function<DiscountedLineItemPortionDraftBuilder, DiscountedLineItemPortionDraftBuilder> builder) Discounts to be applied.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
withIncludedDiscounts
public DiscountedLineItemPriceDraftBuilder withIncludedDiscounts(Function<DiscountedLineItemPortionDraftBuilder, DiscountedLineItemPortionDraftBuilder> builder) Discounts to be applied.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
addIncludedDiscounts
public DiscountedLineItemPriceDraftBuilder addIncludedDiscounts(Function<DiscountedLineItemPortionDraftBuilder, DiscountedLineItemPortionDraft> builder) Discounts to be applied.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
setIncludedDiscounts
public DiscountedLineItemPriceDraftBuilder setIncludedDiscounts(Function<DiscountedLineItemPortionDraftBuilder, DiscountedLineItemPortionDraft> builder) Discounts to be applied.
- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
getValue
Discounted money value.
- Returns:
- value
-
getIncludedDiscounts
Discounts to be applied.
- Returns:
- includedDiscounts
-
build
builds DiscountedLineItemPriceDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountedLineItemPriceDraft>
- Returns:
- DiscountedLineItemPriceDraft
-
buildUnchecked
builds DiscountedLineItemPriceDraft without checking for non-null required values- Returns:
- DiscountedLineItemPriceDraft
-
of
factory method for an instance of DiscountedLineItemPriceDraftBuilder- Returns:
- builder
-
of
create builder for DiscountedLineItemPriceDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-