Class ItemShippingDetailsBuilder
java.lang.Object
com.commercetools.history.models.common.ItemShippingDetailsBuilder
- All Implemented Interfaces:
Builder<ItemShippingDetails>
ItemShippingDetailsBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ItemShippingDetails itemShippingDetails = ItemShippingDetails.builder()
.plusTargets(targetsBuilder -> targetsBuilder)
.valid(true)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd the value to the targets using the builder functionbuild()
builds ItemShippingDetails with checking for non-null required valuesbuilds ItemShippingDetails without checking for non-null required valuesvalue of targets}getValid()
true if the quantity of the (custom) line item is equal to the sum of the sub-quantities intargets
,false
otherwise.static ItemShippingDetailsBuilder
of()
factory method for an instance of ItemShippingDetailsBuilderstatic ItemShippingDetailsBuilder
of
(ItemShippingDetails template) create builder for ItemShippingDetails instanceplusTargets
(ItemShippingTarget... targets) add values to the targetsadd the value to the targets using the builder functionset the value to the targets using the builder functiontargets
(ItemShippingTarget... targets) set values to the targetstargets
(List<ItemShippingTarget> targets) set value to the targetstrue if the quantity of the (custom) line item is equal to the sum of the sub-quantities intargets
,false
otherwise.set the value to the targets using the builder function
-
Constructor Details
-
ItemShippingDetailsBuilder
public ItemShippingDetailsBuilder()
-
-
Method Details
-
targets
set values to the targets- Parameters:
targets
- value to be set- Returns:
- Builder
-
targets
set value to the targets- Parameters:
targets
- value to be set- Returns:
- Builder
-
plusTargets
add values to the targets- Parameters:
targets
- value to be set- Returns:
- Builder
-
plusTargets
public ItemShippingDetailsBuilder plusTargets(Function<ItemShippingTargetBuilder, ItemShippingTargetBuilder> builder) add the value to the targets using the builder function- Parameters:
builder
- function to build the targets value- Returns:
- Builder
-
withTargets
public ItemShippingDetailsBuilder withTargets(Function<ItemShippingTargetBuilder, ItemShippingTargetBuilder> builder) set the value to the targets using the builder function- Parameters:
builder
- function to build the targets value- Returns:
- Builder
-
addTargets
public ItemShippingDetailsBuilder addTargets(Function<ItemShippingTargetBuilder, ItemShippingTarget> builder) add the value to the targets using the builder function- Parameters:
builder
- function to build the targets value- Returns:
- Builder
-
setTargets
public ItemShippingDetailsBuilder setTargets(Function<ItemShippingTargetBuilder, ItemShippingTarget> builder) set the value to the targets using the builder function- Parameters:
builder
- function to build the targets value- Returns:
- Builder
-
valid
true if the quantity of the (custom) line item is equal to the sum of the sub-quantities in
targets
,false
otherwise. A cart cannot be ordered when the value isfalse
. The error InvalidItemShippingDetails will be triggered.- Parameters:
valid
- value to be set- Returns:
- Builder
-
getTargets
value of targets}- Returns:
- targets
-
getValid
true if the quantity of the (custom) line item is equal to the sum of the sub-quantities in
targets
,false
otherwise. A cart cannot be ordered when the value isfalse
. The error InvalidItemShippingDetails will be triggered.- Returns:
- valid
-
build
builds ItemShippingDetails with checking for non-null required values- Specified by:
build
in interfaceBuilder<ItemShippingDetails>
- Returns:
- ItemShippingDetails
-
buildUnchecked
builds ItemShippingDetails without checking for non-null required values- Returns:
- ItemShippingDetails
-
of
factory method for an instance of ItemShippingDetailsBuilder- Returns:
- builder
-
of
create builder for ItemShippingDetails instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-