Class ItemShippingTargetBuilder
java.lang.Object
com.commercetools.history.models.common.ItemShippingTargetBuilder
- All Implemented Interfaces:
Builder<ItemShippingTarget>
ItemShippingTargetBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ItemShippingTarget itemShippingTarget = ItemShippingTarget.builder()
.addressKey("{addressKey}")
.quantity(1)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddressKey
(String addressKey) The key of the address in the cart'sitemShippingAddresses
build()
builds ItemShippingTarget with checking for non-null required valuesbuilds ItemShippingTarget without checking for non-null required valuesThe key of the address in the cart'sitemShippingAddresses
The quantity of items that should go to the address with the specifiedaddressKey
.static ItemShippingTargetBuilder
of()
factory method for an instance of ItemShippingTargetBuilderstatic ItemShippingTargetBuilder
of
(ItemShippingTarget template) create builder for ItemShippingTarget instanceThe quantity of items that should go to the address with the specifiedaddressKey
.
-
Constructor Details
-
ItemShippingTargetBuilder
public ItemShippingTargetBuilder()
-
-
Method Details
-
addressKey
The key of the address in the cart's
itemShippingAddresses
- Parameters:
addressKey
- value to be set- Returns:
- Builder
-
quantity
The quantity of items that should go to the address with the specified
addressKey
. Only positive values are allowed. Using0
as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.- Parameters:
quantity
- value to be set- Returns:
- Builder
-
getAddressKey
The key of the address in the cart's
itemShippingAddresses
- Returns:
- addressKey
-
getQuantity
The quantity of items that should go to the address with the specified
addressKey
. Only positive values are allowed. Using0
as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.- Returns:
- quantity
-
build
builds ItemShippingTarget with checking for non-null required values- Specified by:
build
in interfaceBuilder<ItemShippingTarget>
- Returns:
- ItemShippingTarget
-
buildUnchecked
builds ItemShippingTarget without checking for non-null required values- Returns:
- ItemShippingTarget
-
of
factory method for an instance of ItemShippingTargetBuilder- Returns:
- builder
-
of
create builder for ItemShippingTarget instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-