Class DeliveryDraftBuilder
java.lang.Object
com.commercetools.importapi.models.order_patches.DeliveryDraftBuilder
- All Implemented Interfaces:
Builder<DeliveryDraft>
DeliveryDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DeliveryDraft deliveryDraft = DeliveryDraft.builder()
.plusItems(itemsBuilder -> itemsBuilder)
.plusParcels(parcelsBuilder -> parcelsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) add the value to the items using the builder functionadd the value to the parcels using the builder functionset the value to the addressaddress
(Function<AddressBuilder, AddressBuilder> builder) set the value to the address using the builder functionbuild()
builds DeliveryDraft with checking for non-null required valuesbuilds DeliveryDraft without checking for non-null required valuesvalue of address}getItems()
value of items}value of parcels}items
(DeliveryItem... items) set values to the itemsitems
(List<DeliveryItem> items) set value to the itemsstatic DeliveryDraftBuilder
of()
factory method for an instance of DeliveryDraftBuilderstatic DeliveryDraftBuilder
of
(DeliveryDraft template) create builder for DeliveryDraft instanceparcels
(DeliveryParcelDraft... parcels) set values to the parcelsparcels
(List<DeliveryParcelDraft> parcels) set value to the parcelsplusItems
(DeliveryItem... items) add values to the itemsadd the value to the items using the builder functionplusParcels
(DeliveryParcelDraft... parcels) add values to the parcelsadd the value to the parcels using the builder functionsetItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) set the value to the items using the builder functionset the value to the parcels using the builder functionwithAddress
(Function<AddressBuilder, Address> builder) set the value to the address using the builder functionset the value to the items using the builder functionset the value to the parcels using the builder function
-
Constructor Details
-
DeliveryDraftBuilder
public DeliveryDraftBuilder()
-
-
Method Details
-
items
set values to the items- Parameters:
items
- value to be set- Returns:
- Builder
-
items
set value to the items- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
add values to the items- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
add the value to the items using the builder function- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
withItems
set the value to the items using the builder function- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
addItems
add the value to the items using the builder function- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
setItems
set the value to the items using the builder function- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
address
set the value to the address using the builder function- Parameters:
builder
- function to build the address value- Returns:
- Builder
-
withAddress
set the value to the address using the builder function- Parameters:
builder
- function to build the address value- Returns:
- Builder
-
address
set the value to the address- Parameters:
address
- value to be set- Returns:
- Builder
-
parcels
set values to the parcels- Parameters:
parcels
- value to be set- Returns:
- Builder
-
parcels
set value to the parcels- Parameters:
parcels
- value to be set- Returns:
- Builder
-
plusParcels
add values to the parcels- Parameters:
parcels
- value to be set- Returns:
- Builder
-
plusParcels
public DeliveryDraftBuilder plusParcels(Function<DeliveryParcelDraftBuilder, DeliveryParcelDraftBuilder> builder) add the value to the parcels using the builder function- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
withParcels
public DeliveryDraftBuilder withParcels(Function<DeliveryParcelDraftBuilder, DeliveryParcelDraftBuilder> builder) set the value to the parcels using the builder function- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
addParcels
public DeliveryDraftBuilder addParcels(Function<DeliveryParcelDraftBuilder, DeliveryParcelDraft> builder) add the value to the parcels using the builder function- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
setParcels
public DeliveryDraftBuilder setParcels(Function<DeliveryParcelDraftBuilder, DeliveryParcelDraft> builder) set the value to the parcels using the builder function- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
getItems
value of items}- Returns:
- items
-
getAddress
value of address}- Returns:
- address
-
getParcels
value of parcels}- Returns:
- parcels
-
build
builds DeliveryDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<DeliveryDraft>
- Returns:
- DeliveryDraft
-
buildUnchecked
builds DeliveryDraft without checking for non-null required values- Returns:
- DeliveryDraft
-
of
factory method for an instance of DeliveryDraftBuilder- Returns:
- builder
-
of
create builder for DeliveryDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-