Class DeliveryParcelBuilder
java.lang.Object
com.commercetools.importapi.models.order_patches.DeliveryParcelBuilder
- All Implemented Interfaces:
Builder<DeliveryParcel>
DeliveryParcelBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DeliveryParcel deliveryParcel = DeliveryParcel.builder()
.deliveryId("{deliveryId}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddItems
(Function<DeliveryItemBuilder, DeliveryItem> builder) add the value to the items using the builder functionbuild()
builds DeliveryParcel with checking for non-null required valuesbuilds DeliveryParcel without checking for non-null required valuesdeliveryId
(String deliveryId) set the value to the deliveryIdvalue of deliveryId}getItems()
value of items}value of measurements}value of trackingData}items
(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 DeliveryParcelBuilder
of()
factory method for an instance of DeliveryParcelBuilderstatic DeliveryParcelBuilder
of
(DeliveryParcel template) create builder for DeliveryParcel 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 functionset 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
-
DeliveryParcelBuilder
public DeliveryParcelBuilder()
-
-
Method Details
-
deliveryId
set the value to the deliveryId- Parameters:
deliveryId
- value to be set- Returns:
- Builder
-
measurements
public DeliveryParcelBuilder 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 DeliveryParcelBuilder 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
public DeliveryParcelBuilder trackingData(Function<TrackingDataBuilder, TrackingDataBuilder> builder) 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
-
getDeliveryId
value of deliveryId}- Returns:
- deliveryId
-
getMeasurements
value of measurements}- Returns:
- measurements
-
getTrackingData
value of trackingData}- Returns:
- trackingData
-
getItems
value of items}- Returns:
- items
-
build
builds DeliveryParcel with checking for non-null required values- Specified by:
build
in interfaceBuilder<DeliveryParcel>
- Returns:
- DeliveryParcel
-
buildUnchecked
builds DeliveryParcel without checking for non-null required values- Returns:
- DeliveryParcel
-
of
factory method for an instance of DeliveryParcelBuilder- Returns:
- builder
-
of
create builder for DeliveryParcel instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-