Interface Parcel
public interface Parcel
Parcel
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()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ParcelBuilder
builder()
builder factory method for Parcelstatic ParcelBuilder
create builder for Parcel instancecopyDeep()
static Parcel
factory method to create a deep copy of Parcel@NotNull ZonedDateTime
Date and time (UTC) the Parcel was created.@Valid Custom
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.@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
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
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 function
-
Method Details
-
getId
Unique identifier of the Parcel.
- Returns:
- id
-
getCreatedAt
Date and time (UTC) the Parcel was created.
- Returns:
- createdAt
-
getMeasurements
Information about the dimensions of the Parcel.
- Returns:
- measurements
-
getTrackingData
Shipment tracking information of the Parcel.
- Returns:
- trackingData
-
getItems
Line Items or Custom Line Items delivered in this Parcel.
- Returns:
- items
-
getCustom
Custom Fields of the Parcel.
- Returns:
- custom
-
setId
Unique identifier of the Parcel.
- Parameters:
id
- 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.
- 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
-