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 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 CustomCustom 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.@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.voidCustom 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.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 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
-