Class ParcelBuilder
java.lang.Object
com.commercetools.importapi.models.orders.ParcelBuilder
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) add the value to the items using the builder functionbuild()
builds Parcel with checking for non-null required valuesbuilds Parcel without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) set the value to the createdAtThe representation to be sent to the server when creating a resource with Custom Fields.custom
(Function<CustomBuilder, CustomBuilder> builder) The representation to be sent to the server when creating a resource with Custom Fields.value of createdAt}The representation to be sent to the server when creating a resource with Custom Fields.getId()
value of id}getItems()
value of items}value of measurements}value of trackingData}set the value to the iditems
(DeliveryItem... items) set values to the itemsitems
(List<DeliveryItem> items) set value to the itemsmeasurements
(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) add values to the itemsadd the value to the items using the builder functionsetItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) set the value to the items using the builder functiontrackingData
(TrackingData trackingData) set the value to the trackingDataset the value to the trackingData using the builder functionwithCustom
(Function<CustomBuilder, Custom> builder) The representation to be sent to the server when creating a resource with Custom Fields.set the value to the items using the builder functionset 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
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
-
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
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
-
custom
The representation to be sent to the server when creating a resource with Custom Fields.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
The representation to be sent to the server when creating a resource with Custom Fields.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
The representation to be sent to the server when creating a resource with Custom Fields.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
value of id}- Returns:
- id
-
getCreatedAt
value of createdAt}- Returns:
- createdAt
-
getMeasurements
value of measurements}- Returns:
- measurements
-
getTrackingData
value of trackingData}- Returns:
- trackingData
-
getItems
value of items}- Returns:
- items
-
getCustom
The representation to be sent to the server when creating a resource with Custom Fields.
- Returns:
- custom
-
build
builds Parcel with checking for non-null required values -
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
-