Interface Parcel


public interface Parcel
Parcel
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 Details

    • getId

      @NotNull @NotNull String getId()
      Returns:
      id
    • getCreatedAt

      @NotNull @NotNull String getCreatedAt()
      Returns:
      createdAt
    • getMeasurements

      @NotNull @Valid @NotNull @Valid ParcelMeasurements getMeasurements()
      Returns:
      measurements
    • getTrackingData

      @NotNull @Valid @NotNull @Valid TrackingData getTrackingData()
      Returns:
      trackingData
    • getItems

      @NotNull @Valid @NotNull @Valid List<DeliveryItem> getItems()
      Returns:
      items
    • setId

      void setId(String id)
      set id
      Parameters:
      id - value to be set
    • setCreatedAt

      void setCreatedAt(String createdAt)
      set createdAt
      Parameters:
      createdAt - value to be set
    • setMeasurements

      void setMeasurements(ParcelMeasurements measurements)
      set measurements
      Parameters:
      measurements - value to be set
    • setTrackingData

      void setTrackingData(TrackingData trackingData)
      set trackingData
      Parameters:
      trackingData - value to be set
    • setItems

      void setItems(DeliveryItem... items)
      set items
      Parameters:
      items - values to be set
    • setItems

      void setItems(List<DeliveryItem> items)
      set items
      Parameters:
      items - values to be set
    • of

      static Parcel of()
      factory method
      Returns:
      instance of Parcel
    • of

      static Parcel of(Parcel template)
      factory method to create a shallow copy Parcel
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static Parcel deepCopy(@Nullable Parcel template)
      factory method to create a deep copy of Parcel
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ParcelBuilder builder()
      builder factory method for Parcel
      Returns:
      builder
    • builder

      static ParcelBuilder builder(Parcel template)
      create builder for Parcel instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withParcel

      default <T> T withParcel(Function<Parcel,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<Parcel> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference