Class ParcelBuilder
java.lang.Object
com.commercetools.api.models.order.ParcelBuilder
- All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<Parcel>
ParcelBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Parcel parcel = Parcel.builder()
.id("{id}")
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) The delivery items contained in this parcel.build()
builds Parcel with checking for non-null required valuesbuilds Parcel without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) set the value to the createdAtcustom
(CustomFields custom) Custom Fields of this parcel.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields of this parcel.value of createdAt}Custom Fields of this parcel.getId()
Unique identifier of the Parcel.getItems()
The delivery items contained in this parcel.getKey()
User-defined unique identifier of the Parcel.value of measurements}value of trackingData}Unique identifier of the Parcel.items
(DeliveryItem... items) The delivery items contained in this parcel.items
(List<DeliveryItem> items) The delivery items contained in this parcel.User-defined unique identifier of the Parcel.measurements
(ParcelMeasurements measurements) set the value to the measurementsset the value to the measurements using the builder functionstatic ParcelBuilder
of()
factory method for an instance of ParcelBuilderstatic ParcelBuilder
create builder for Parcel instanceplusItems
(DeliveryItem... items) The delivery items contained in this parcel.The delivery items contained in this parcel.setItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) The delivery items contained in this parcel.trackingData
(TrackingData trackingData) set the value to the trackingDataset the value to the trackingData using the builder functionwithCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields of this parcel.The delivery items contained in this parcel.set the value to the measurements using the builder functionset the value to the trackingData using the builder function
-
Constructor Details
-
ParcelBuilder
public ParcelBuilder()
-
-
Method Details
-
id
Unique identifier of the Parcel.
- Parameters:
id
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Parcel.
- Parameters:
key
- value to be set- Returns:
- Builder
-
createdAt
set the value to the createdAt- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
measurements
public ParcelBuilder measurements(Function<ParcelMeasurementsBuilder, ParcelMeasurementsBuilder> builder) set the value to the measurements using the builder function- Parameters:
builder
- function to build the measurements value- Returns:
- Builder
-
withMeasurements
public ParcelBuilder withMeasurements(Function<ParcelMeasurementsBuilder, ParcelMeasurements> builder) set the value to the measurements using the builder function- Parameters:
builder
- function to build the measurements value- Returns:
- Builder
-
measurements
set the value to the measurements- Parameters:
measurements
- value to be set- Returns:
- Builder
-
trackingData
set the value to the trackingData using the builder function- Parameters:
builder
- function to build the trackingData value- Returns:
- Builder
-
withTrackingData
set the value to the trackingData using the builder function- Parameters:
builder
- function to build the trackingData value- Returns:
- Builder
-
trackingData
set the value to the trackingData- Parameters:
trackingData
- value to be set- Returns:
- Builder
-
items
The delivery items contained in this parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
items
The delivery items contained in this parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
The delivery items contained in this parcel.
- Parameters:
items
- value to be set- Returns:
- Builder
-
plusItems
The delivery items contained in this parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
withItems
The delivery items contained in this parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
addItems
The delivery items contained in this parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
setItems
The delivery items contained in this parcel.
- Parameters:
builder
- function to build the items value- Returns:
- Builder
-
custom
Custom Fields of this parcel.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields of this parcel.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields of this parcel.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Parcel.
- Returns:
- id
-
getKey
User-defined unique identifier of the Parcel.
- Returns:
- key
-
getCreatedAt
value of createdAt}- Returns:
- createdAt
-
getMeasurements
value of measurements}- Returns:
- measurements
-
getTrackingData
value of trackingData}- Returns:
- trackingData
-
getItems
The delivery items contained in this parcel.
- Returns:
- items
-
getCustom
Custom Fields of this parcel.
- Returns:
- custom
-
build
builds Parcel with checking for non-null required values- Specified by:
build
in interfaceio.vrap.rmf.base.client.Builder<Parcel>
- Returns:
- Parcel
-
buildUnchecked
builds Parcel without checking for non-null required values- Returns:
- Parcel
-
of
factory method for an instance of ParcelBuilder- Returns:
- builder
-
of
create builder for Parcel instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-