Interface Parcel
- All Superinterfaces:
Customizable<Parcel>,ParcelMixin
Information regarding the appearance, content, and shipment of a Parcel.
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()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ParcelBuilderbuilder()builder factory method for Parcelstatic ParcelBuildercreate builder for Parcel instancecopyDeep()static Parcelfactory method to create a deep copy of Parcel@NotNull ZonedDateTimeDate and time (UTC) the Parcel was created.@Valid CustomFieldsCustom Fields of the Parcel.@NotNull StringgetId()Unique identifier of the Parcel.@Valid List<DeliveryItem>getItems()Line Items or Custom Line Items delivered in this Parcel.getKey()User-defined unique identifier of the Parcel.@Valid ParcelMeasurementsInformation about the dimensions of the Parcel.@Valid TrackingDataShipment tracking information of the Parcel.static Parcelof()factory methodstatic Parcelfactory method to create a shallow copy ParcelvoidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Parcel was created.voidsetCustom(CustomFields custom) Custom Fields of the Parcel.voidUnique identifier of the Parcel.voidsetItems(DeliveryItem... items) Line Items or Custom Line Items delivered in this Parcel.voidsetItems(List<DeliveryItem> items) Line Items or Custom Line Items delivered in this Parcel.voidUser-defined unique identifier of the Parcel.voidsetMeasurements(ParcelMeasurements measurements) Information about the dimensions of the Parcel.voidsetTrackingData(TrackingData trackingData) Shipment tracking information of the Parcel.static com.fasterxml.jackson.core.type.TypeReference<Parcel>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithParcel(Function<Parcel, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizableMethods inherited from interface com.commercetools.api.models.order.ParcelMixin
toDraft, toDraftBuilder
-
Method Details
-
getId
Unique identifier of the Parcel.
- Returns:
- id
-
getKey
String getKey()User-defined unique identifier of the Parcel.
- Returns:
- key
-
getCreatedAt
Date and time (UTC) the Parcel was created.
- Returns:
- createdAt
-
getMeasurements
Information about the dimensions of the Parcel.
- Specified by:
getMeasurementsin interfaceParcelMixin- Returns:
- measurements
-
getTrackingData
Shipment tracking information of the Parcel.
- Specified by:
getTrackingDatain interfaceParcelMixin- Returns:
- trackingData
-
getItems
Line Items or Custom Line Items delivered in this Parcel.
- Specified by:
getItemsin interfaceParcelMixin- Returns:
- items
-
getCustom
Custom Fields of the Parcel.
- Specified by:
getCustomin interfaceCustomizable<Parcel>- Specified by:
getCustomin interfaceParcelMixin- Returns:
- custom
-
setId
Unique identifier of the Parcel.
- Parameters:
id- value to be set
-
setKey
User-defined unique identifier of the Parcel.
- Parameters:
key- value to be set
-
setCreatedAt
Date and time (UTC) the Parcel was created.
- Parameters:
createdAt- value to be set
-
setMeasurements
Information about the dimensions of the Parcel.
- Parameters:
measurements- value to be set
-
setTrackingData
Shipment tracking information of the Parcel.
- Parameters:
trackingData- value to be set
-
setItems
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
items- values to be set
-
setItems
Line Items or Custom Line Items delivered in this Parcel.
- Parameters:
items- values to be set
-
setCustom
Custom Fields of the Parcel.
- Specified by:
setCustomin interfaceCustomizable<Parcel>- Parameters:
custom- value to be set
-
of
factory method- Returns:
- instance of Parcel
-
of
factory method to create a shallow copy Parcel- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
Parcel copyDeep() -
deepCopy
factory method to create a deep copy of Parcel- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Parcel- Returns:
- builder
-
builder
create builder for Parcel instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withParcel
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-