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 ParcelBuilder
builder()
builder factory method for Parcelstatic ParcelBuilder
create builder for Parcel instancestatic Parcel
factory method to create a deep copy of Parcel@NotNull ZonedDateTime
Date and time (UTC) the Parcel was created.@Valid CustomFields
Custom Fields of the Parcel.@NotNull String
getId()
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 ParcelMeasurements
Information about the dimensions of the Parcel.@Valid TrackingData
Shipment tracking information of the Parcel.static Parcel
of()
factory methodstatic Parcel
factory method to create a shallow copy Parcelvoid
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Parcel was created.void
setCustom
(CustomFields custom) Custom Fields of the Parcel.void
Unique identifier of the Parcel.void
setItems
(DeliveryItem... items) Line Items or Custom Line Items delivered in this Parcel.void
setItems
(List<DeliveryItem> items) Line Items or Custom Line Items delivered in this Parcel.void
User-defined unique identifier of the Parcel.void
setMeasurements
(ParcelMeasurements measurements) Information about the dimensions of the Parcel.void
setTrackingData
(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> T
withParcel
(Function<Parcel, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
Methods 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:
getMeasurements
in interfaceParcelMixin
- Returns:
- measurements
-
getTrackingData
Shipment tracking information of the Parcel.
- Specified by:
getTrackingData
in interfaceParcelMixin
- Returns:
- trackingData
-
getItems
Line Items or Custom Line Items delivered in this Parcel.
- Specified by:
getItems
in interfaceParcelMixin
- Returns:
- items
-
getCustom
Custom Fields of the Parcel.
- Specified by:
getCustom
in interfaceCustomizable<Parcel>
- Specified by:
getCustom
in 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:
setCustom
in 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
-
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
-