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("{createdAt}")
.measurements(measurementsBuilder -> measurementsBuilder)
.trackingData(trackingDataBuilder -> trackingDataBuilder)
.plusItems(itemsBuilder -> itemsBuilder)
.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 String
@NotNull String
getId()
@NotNull @Valid List<DeliveryItem>
getItems()
@NotNull @Valid ParcelMeasurements
@NotNull @Valid TrackingData
static Parcel
of()
factory methodstatic Parcel
factory method to create a shallow copy Parcelvoid
setCreatedAt
(String createdAt) set createdAtvoid
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
-
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
-
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
-