Class DeliveryDraftBuilder
- All Implemented Interfaces:
Builder<DeliveryDraft>
Example to create an instance using the builder pattern
DeliveryDraft deliveryDraft = DeliveryDraft.builder()
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) Line Items or Custom Line Items to deliver.addParcels
(Function<ParcelDraftBuilder, ParcelDraft> builder) Information regarding the appearance, content, and shipment of a parcel.address
(AddressDraft address) Address to which the Parcels are delivered.Address to which the Parcels are delivered.build()
builds DeliveryDraft with checking for non-null required valuesbuilds DeliveryDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields for the Delivery.Custom Fields for the Delivery.Address to which the Parcels are delivered.Custom Fields for the Delivery.getItems()
Line Items or Custom Line Items to deliver.getKey()
User-defined unique identifier of the Delivery.Information regarding the appearance, content, and shipment of a parcel.items
(DeliveryItem... items) Line Items or Custom Line Items to deliver.items
(List<DeliveryItem> items) Line Items or Custom Line Items to deliver.User-defined unique identifier of the Delivery.static DeliveryDraftBuilder
of()
factory method for an instance of DeliveryDraftBuilderstatic DeliveryDraftBuilder
of
(DeliveryDraft template) create builder for DeliveryDraft instanceparcels
(ParcelDraft... parcels) Information regarding the appearance, content, and shipment of a parcel.parcels
(List<ParcelDraft> parcels) Information regarding the appearance, content, and shipment of a parcel.plusItems
(DeliveryItem... items) Line Items or Custom Line Items to deliver.Line Items or Custom Line Items to deliver.plusParcels
(ParcelDraft... parcels) Information regarding the appearance, content, and shipment of a parcel.Information regarding the appearance, content, and shipment of a parcel.setItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) Line Items or Custom Line Items to deliver.setParcels
(Function<ParcelDraftBuilder, ParcelDraft> builder) Information regarding the appearance, content, and shipment of a parcel.withAddress
(Function<AddressDraftBuilder, AddressDraft> builder) Address to which the Parcels are delivered.Custom Fields for the Delivery.Line Items or Custom Line Items to deliver.Information regarding the appearance, content, and shipment of a parcel.
-
Constructor Details
-
DeliveryDraftBuilder
public DeliveryDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier of the Delivery.
- Parameters:
key
- value to be set- Returns:
- Builder
-
items
Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
items
Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
withItems
Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
addItems
Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
setItems
Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel.
- 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 the Parcels are delivered.
- Parameters:
builder
- function to build the address value- Returns:
- Builder
-
withAddress
Address to which the Parcels are delivered.
- Parameters:
builder
- function to build the address value- Returns:
- Builder
-
address
Address to which the Parcels are delivered.
- Parameters:
address
- value to be set- Returns:
- Builder
-
custom
public DeliveryDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Delivery.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public DeliveryDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the Delivery.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Delivery.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier of the Delivery.
- Returns:
- key
-
getItems
Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel.
- Returns:
- items
-
getParcels
Information regarding the appearance, content, and shipment of a parcel.
- Returns:
- parcels
-
getAddress
Address to which the Parcels are delivered.
- Returns:
- address
-
getCustom
Custom Fields for the Delivery.
- Returns:
- custom
-
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
-