Class DeliveryBuilder
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) Line Items or Custom Line Items that are delivered.addParcels
(Function<ParcelBuilder, Parcel> builder) Information regarding the appearance, content, and shipment of a Parcel.Address to which Parcels are delivered.address
(Function<AddressBuilder, AddressBuilder> builder) Address to which Parcels are delivered.build()
builds Delivery with checking for non-null required valuesbuilds Delivery without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Delivery was created.custom
(CustomFields custom) Custom Fields of the Delivery.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields of the Delivery.Address to which Parcels are delivered.Date and time (UTC) the Delivery was created.Custom Fields of the Delivery.getId()
Unique identifier of the Delivery.getItems()
Line Items or Custom Line Items that are delivered.getKey()
User-defined unique identifier of the Delivery.Information regarding the appearance, content, and shipment of a Parcel.Unique identifier of the Delivery.items
(DeliveryItem... items) Line Items or Custom Line Items that are delivered.items
(List<DeliveryItem> items) Line Items or Custom Line Items that are delivered.User-defined unique identifier of the Delivery.static DeliveryBuilder
of()
factory method for an instance of DeliveryBuilderstatic DeliveryBuilder
create builder for Delivery instanceInformation regarding the appearance, content, and shipment of a Parcel.Information regarding the appearance, content, and shipment of a Parcel.plusItems
(DeliveryItem... items) Line Items or Custom Line Items that are delivered.Line Items or Custom Line Items that are delivered.plusParcels
(Parcel... parcels) Information regarding the appearance, content, and shipment of a Parcel.plusParcels
(Function<ParcelBuilder, ParcelBuilder> builder) Information regarding the appearance, content, and shipment of a Parcel.setItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) Line Items or Custom Line Items that are delivered.setParcels
(Function<ParcelBuilder, Parcel> builder) Information regarding the appearance, content, and shipment of a Parcel.withAddress
(Function<AddressBuilder, Address> builder) Address to which Parcels are delivered.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields of the Delivery.Line Items or Custom Line Items that are delivered.withParcels
(Function<ParcelBuilder, ParcelBuilder> builder) Information regarding the appearance, content, and shipment of a Parcel.
-
Constructor Details
-
DeliveryBuilder
public DeliveryBuilder()
-
-
Method Details
-
id
Unique identifier of the Delivery.
- Parameters:
id
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Delivery.
- Parameters:
key
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Delivery was created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
items
Line Items or Custom Line Items that are delivered.
- Parameters:
items
- value to be set- Returns:
- Builder
-
items
Line Items or Custom Line Items that are delivered.
- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
Line Items or Custom Line Items that are delivered.
- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
Line Items or Custom Line Items that are delivered.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
withItems
Line Items or Custom Line Items that are delivered.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
addItems
Line Items or Custom Line Items that are delivered.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
setItems
Line Items or Custom Line Items that are delivered.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
parcels
Information regarding the appearance, content, and shipment of a Parcel.
- Parameters:
parcels
- value to be set- Returns:
- Builder
-
parcels
Information regarding the appearance, content, and shipment of a Parcel.
- Parameters:
parcels
- value to be set- Returns:
- Builder
-
plusParcels
Information regarding the appearance, content, and shipment of a Parcel.
- Parameters:
parcels
- value to be set- Returns:
- Builder
-
plusParcels
Information regarding the appearance, content, and shipment of a Parcel.
- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
withParcels
Information regarding the appearance, content, and shipment of a Parcel.
- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
addParcels
Information regarding the appearance, content, and shipment of a Parcel.
- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
setParcels
Information regarding the appearance, content, and shipment of a Parcel.
- Parameters:
builder
- function to build the parcels value- Returns:
- Builder
-
address
Address to which Parcels are delivered.
- Parameters:
builder
- function to build the address value- Returns:
- Builder
-
withAddress
Address to which Parcels are delivered.
- Parameters:
builder
- function to build the address value- Returns:
- Builder
-
address
Address to which Parcels are delivered.
- Parameters:
address
- value to be set- Returns:
- Builder
-
custom
Custom Fields of the Delivery.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields of the Delivery.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields of the Delivery.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Delivery.
- Returns:
- id
-
getKey
User-defined unique identifier of the Delivery.
- Returns:
- key
-
getCreatedAt
Date and time (UTC) the Delivery was created.
- Returns:
- createdAt
-
getItems
Line Items or Custom Line Items that are delivered.
- Returns:
- items
-
getParcels
Information regarding the appearance, content, and shipment of a Parcel.
- Returns:
- parcels
-
getAddress
Address to which Parcels are delivered.
- Returns:
- address
-
getCustom
Custom Fields of the Delivery.
- Returns:
- custom
-
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
-