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 instancestatic Parcel
factory method to create a deep copy of Parcel@NotNull ZonedDateTime
@Valid Custom
The representation to be sent to the server when creating a resource with Custom Fields.@NotNull String
getId()
@Valid List<DeliveryItem>
getItems()
@Valid ParcelMeasurements
@Valid TrackingData
static Parcel
of()
factory methodstatic Parcel
factory method to create a shallow copy Parcelvoid
setCreatedAt
(ZonedDateTime createdAt) set createdAtvoid
The representation to be sent to the server when creating a resource with Custom Fields.void
set idvoid
setItems
(DeliveryItem... items) set itemsvoid
setItems
(List<DeliveryItem> items) set itemsvoid
setMeasurements
(ParcelMeasurements measurements) set measurementsvoid
setTrackingData
(TrackingData trackingData) set trackingDatastatic 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
- Returns:
- id
-
getCreatedAt
- Returns:
- createdAt
-
getMeasurements
- Returns:
- measurements
-
getTrackingData
- Returns:
- trackingData
-
getItems
- Returns:
- items
-
getCustom
The representation to be sent to the server when creating a resource with Custom Fields.
- Returns:
- custom
-
setId
set id- Parameters:
id
- value to be set
-
setCreatedAt
set createdAt- Parameters:
createdAt
- value to be set
-
setMeasurements
set measurements- Parameters:
measurements
- value to be set
-
setTrackingData
set trackingData- Parameters:
trackingData
- value to be set
-
setItems
set items- Parameters:
items
- values to be set
-
setItems
set items- Parameters:
items
- values to be set
-
setCustom
The representation to be sent to the server when creating a resource with Custom Fields.
- 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
-