Class DiscountedLineItemPriceBuilder
java.lang.Object
com.commercetools.history.models.common.DiscountedLineItemPriceBuilder
- All Implemented Interfaces:
Builder<DiscountedLineItemPrice>
public class DiscountedLineItemPriceBuilder
extends Object
implements Builder<DiscountedLineItemPrice>
DiscountedLineItemPriceBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DiscountedLineItemPrice discountedLineItemPrice = DiscountedLineItemPrice.builder()
.value(valueBuilder -> valueBuilder)
.plusIncludedDiscounts(includedDiscountsBuilder -> includedDiscountsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd the value to the includedDiscounts using the builder functionbuild()
builds DiscountedLineItemPrice with checking for non-null required valuesbuilds DiscountedLineItemPrice without checking for non-null required valuesvalue of includedDiscounts}getValue()
value of value}includedDiscounts
(DiscountedLineItemPortion... includedDiscounts) set values to the includedDiscountsincludedDiscounts
(List<DiscountedLineItemPortion> includedDiscounts) set value to the includedDiscountsof()
factory method for an instance of DiscountedLineItemPriceBuilderof
(DiscountedLineItemPrice template) create builder for DiscountedLineItemPrice instanceplusIncludedDiscounts
(DiscountedLineItemPortion... includedDiscounts) add values to the includedDiscountsplusIncludedDiscounts
(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortionBuilder> builder) add the value to the includedDiscounts using the builder functionset the value to the includedDiscounts using the builder functionset the value to the valuevalue
(Function<MoneyBuilder, MoneyBuilder> builder) set the value to the value using the builder functionwithIncludedDiscounts
(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortionBuilder> builder) set the value to the includedDiscounts using the builder functionwithValue
(Function<MoneyBuilder, Money> builder) set the value to the value using the builder function
-
Constructor Details
-
DiscountedLineItemPriceBuilder
public DiscountedLineItemPriceBuilder()
-
-
Method Details
-
value
set the value to the value using the builder function- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
withValue
set the value to the value using the builder function- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
value
set the value to the value- Parameters:
value
- value to be set- Returns:
- Builder
-
includedDiscounts
public DiscountedLineItemPriceBuilder includedDiscounts(DiscountedLineItemPortion... includedDiscounts) set values to the includedDiscounts- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
includedDiscounts
public DiscountedLineItemPriceBuilder includedDiscounts(List<DiscountedLineItemPortion> includedDiscounts) set value to the includedDiscounts- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
plusIncludedDiscounts
public DiscountedLineItemPriceBuilder plusIncludedDiscounts(DiscountedLineItemPortion... includedDiscounts) add values to the includedDiscounts- Parameters:
includedDiscounts
- value to be set- Returns:
- Builder
-
plusIncludedDiscounts
public DiscountedLineItemPriceBuilder plusIncludedDiscounts(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortionBuilder> builder) add the value to the includedDiscounts using the builder function- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
withIncludedDiscounts
public DiscountedLineItemPriceBuilder withIncludedDiscounts(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortionBuilder> builder) set the value to the includedDiscounts using the builder function- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
addIncludedDiscounts
public DiscountedLineItemPriceBuilder addIncludedDiscounts(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortion> builder) add the value to the includedDiscounts using the builder function- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
setIncludedDiscounts
public DiscountedLineItemPriceBuilder setIncludedDiscounts(Function<DiscountedLineItemPortionBuilder, DiscountedLineItemPortion> builder) set the value to the includedDiscounts using the builder function- Parameters:
builder
- function to build the includedDiscounts value- Returns:
- Builder
-
getValue
value of value}- Returns:
- value
-
getIncludedDiscounts
value of includedDiscounts}- Returns:
- includedDiscounts
-
build
builds DiscountedLineItemPrice with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountedLineItemPrice>
- Returns:
- DiscountedLineItemPrice
-
buildUnchecked
builds DiscountedLineItemPrice without checking for non-null required values- Returns:
- DiscountedLineItemPrice
-
of
factory method for an instance of DiscountedLineItemPriceBuilder- Returns:
- builder
-
of
create builder for DiscountedLineItemPrice instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-