Class ParcelDraftBuilder
- All Implemented Interfaces:
Builder<ParcelDraft>
Example to create an instance using the builder pattern
ParcelDraft parcelDraft = ParcelDraft.builder()
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) Line Items or Custom Line Items delivered in this Parcel.build()
builds ParcelDraft with checking for non-null required valuesbuilds ParcelDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields for the Parcel.Custom Fields for the Parcel.Custom Fields for the Parcel.getItems()
Line Items or Custom Line Items delivered in this Parcel.getKey()
User-defined unique identifier of the Parcel.Information about the dimensions for the Parcel.Shipment tracking information for the Parcel.items
(DeliveryItem... items) Line Items or Custom Line Items delivered in this Parcel.items
(List<DeliveryItem> items) Line Items or Custom Line Items delivered in this Parcel.User-defined unique identifier of the Parcel.measurements
(ParcelMeasurements measurements) Information about the dimensions for the Parcel.Information about the dimensions for the Parcel.static ParcelDraftBuilder
of()
factory method for an instance of ParcelDraftBuilderstatic ParcelDraftBuilder
of
(ParcelDraft template) create builder for ParcelDraft instanceplusItems
(DeliveryItem... items) Line Items or Custom Line Items delivered in this Parcel.Line Items or Custom Line Items delivered in this Parcel.setItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) Line Items or Custom Line Items delivered in this Parcel.trackingData
(TrackingData trackingData) Shipment tracking information for the Parcel.Shipment tracking information for the Parcel.Custom Fields for the Parcel.Line Items or Custom Line Items delivered in this Parcel.Information about the dimensions for the Parcel.Shipment tracking information for the Parcel.
-
Constructor Details
-
ParcelDraftBuilder
public ParcelDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier of the Parcel.
- Parameters:
key
- value to be set- Returns:
- Builder
-
measurements
public ParcelDraftBuilder measurements(Function<ParcelMeasurementsBuilder, ParcelMeasurementsBuilder> builder) Information about the dimensions for the Parcel.
- Parameters:
builder
- function to build the measurements value- Returns:
- Builder
-
withMeasurements
public ParcelDraftBuilder withMeasurements(Function<ParcelMeasurementsBuilder, ParcelMeasurements> builder) Information about the dimensions for the Parcel.
- Parameters:
builder
- function to build the measurements value- Returns:
- Builder
-
measurements
Information about the dimensions for the Parcel.
- Parameters:
measurements
- value to be set- Returns:
- Builder
-
trackingData
Shipment tracking information for the Parcel.
- Parameters:
builder
- function to build the trackingData value- Returns:
- Builder
-
withTrackingData
Shipment tracking information for the Parcel.
- Parameters:
builder
- function to build the trackingData value- Returns:
- Builder
-
trackingData
Shipment tracking information for the Parcel.
- Parameters:
trackingData
- value to be set- Returns:
- Builder
-
items
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
items
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
withItems
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
addItems
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
setItems
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
custom
public ParcelDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Parcel.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields for the Parcel.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Parcel.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier of the Parcel.
- Returns:
- key
-
getMeasurements
Information about the dimensions for the Parcel.
- Returns:
- measurements
-
getTrackingData
Shipment tracking information for the Parcel.
- Returns:
- trackingData
-
getItems
Line Items or Custom Line Items delivered in this Parcel.
- Returns:
- items
-
getCustom
Custom Fields for the Parcel.
- Returns:
- custom
-
build
builds ParcelDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ParcelDraft>
- Returns:
- ParcelDraft
-
buildUnchecked
builds ParcelDraft without checking for non-null required values- Returns:
- ParcelDraft
-
of
factory method for an instance of ParcelDraftBuilder- Returns:
- builder
-
of
create builder for ParcelDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-