Class DeliveryBuilder
java.lang.Object
com.commercetools.importapi.models.orders.DeliveryBuilder
DeliveryBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Delivery delivery = Delivery.builder()
.id("{id}")
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.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 functionaddParcels
(Function<ParcelBuilder, Parcel> builder) add 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 Delivery with checking for non-null required valuesbuilds Delivery without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) set the value to the createdAtvalue of address}value of createdAt}getId()
value of id}getItems()
value of items}value of parcels}set the value to the iditems
(DeliveryItem... items) set values to the itemsitems
(List<DeliveryItem> items) set value to the itemsstatic DeliveryBuilder
of()
factory method for an instance of DeliveryBuilderstatic DeliveryBuilder
create builder for Delivery instanceset values to the parcelsset value to the parcelsplusItems
(DeliveryItem... items) add values to the itemsadd the value to the items using the builder functionplusParcels
(Parcel... parcels) add values to the parcelsplusParcels
(Function<ParcelBuilder, ParcelBuilder> builder) add the value to the parcels using the builder functionsetItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) set the value to the items using the builder functionsetParcels
(Function<ParcelBuilder, Parcel> builder) set 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 functionwithParcels
(Function<ParcelBuilder, ParcelBuilder> builder) set the value to the parcels using the builder function
-
Constructor Details
-
DeliveryBuilder
public DeliveryBuilder()
-
-
Method Details
-
id
set the value to the id- Parameters:
id
- value to be set- Returns:
- Builder
-
createdAt
set the value to the createdAt- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
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
-
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
add the value to the parcels using the builder function- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
withParcels
set the value to the parcels using the builder function- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
addParcels
add the value to the parcels using the builder function- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
setParcels
set the value to the parcels using the builder function- Parameters:
builder
- function to build the parcels 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
-
getId
value of id}- Returns:
- id
-
getCreatedAt
value of createdAt}- Returns:
- createdAt
-
getItems
value of items}- Returns:
- items
-
getParcels
value of parcels}- Returns:
- parcels
-
getAddress
value of address}- Returns:
- address
-
build
builds Delivery with checking for non-null required values -
buildUnchecked
builds Delivery without checking for non-null required values- Returns:
- Delivery
-
of
factory method for an instance of DeliveryBuilder- Returns:
- builder
-
of
create builder for Delivery instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-