Interface Delivery


public interface Delivery
Delivery
Example to create an instance using the builder pattern

     Delivery delivery = Delivery.builder()
             .id("{id}")
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .plusItems(itemsBuilder -> itemsBuilder)
             .plusParcels(parcelsBuilder -> parcelsBuilder)
             .build()
 
  • Method Details

    • getId

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

      @NotNull @NotNull ZonedDateTime getCreatedAt()
      Returns:
      createdAt
    • getItems

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

      @NotNull @Valid @NotNull @Valid List<Parcel> getParcels()
      Returns:
      parcels
    • getAddress

      @Valid @Valid Address getAddress()
      Returns:
      address
    • setId

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

      void setCreatedAt(ZonedDateTime createdAt)
      set createdAt
      Parameters:
      createdAt - 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
    • setParcels

      void setParcels(Parcel... parcels)
      set parcels
      Parameters:
      parcels - values to be set
    • setParcels

      void setParcels(List<Parcel> parcels)
      set parcels
      Parameters:
      parcels - values to be set
    • setAddress

      void setAddress(Address address)
      set address
      Parameters:
      address - value to be set
    • of

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

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

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

      static DeliveryBuilder builder()
      builder factory method for Delivery
      Returns:
      builder
    • builder

      static DeliveryBuilder builder(Delivery template)
      create builder for Delivery instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDelivery

      default <T> T withDelivery(Function<Delivery,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<Delivery> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference