Interface Delivery

All Superinterfaces:
Customizable<Delivery>, DeliveryMixin

public interface Delivery extends DeliveryMixin, Customizable<Delivery>

Contains information on how items are shipped to Customers, for example, a delivery note.


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()

      Unique identifier of the Delivery.

      Returns:
      id
    • getKey

      String getKey()

      User-defined unique identifier of the Delivery.

      Returns:
      key
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the Delivery was created.

      Returns:
      createdAt
    • getItems

      @NotNull @Valid @NotNull @Valid List<DeliveryItem> getItems()

      Line Items or Custom Line Items that are delivered.

      Specified by:
      getItems in interface DeliveryMixin
      Returns:
      items
    • getParcels

      @NotNull @Valid @NotNull @Valid List<Parcel> getParcels()

      Information regarding the appearance, content, and shipment of a Parcel.

      Specified by:
      getParcels in interface DeliveryMixin
      Returns:
      parcels
    • getAddress

      @Valid @Valid Address getAddress()

      Address to which Parcels are delivered.

      Specified by:
      getAddress in interface DeliveryMixin
      Returns:
      address
    • getCustom

      @Valid @Valid CustomFields getCustom()

      Custom Fields of the Delivery.

      Specified by:
      getCustom in interface Customizable<Delivery>
      Specified by:
      getCustom in interface DeliveryMixin
      Returns:
      custom
    • setId

      void setId(String id)

      Unique identifier of the Delivery.

      Parameters:
      id - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Delivery.

      Parameters:
      key - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the Delivery was created.

      Parameters:
      createdAt - value to be set
    • setItems

      void setItems(DeliveryItem... items)

      Line Items or Custom Line Items that are delivered.

      Parameters:
      items - values to be set
    • setItems

      void setItems(List<DeliveryItem> items)

      Line Items or Custom Line Items that are delivered.

      Parameters:
      items - values to be set
    • setParcels

      void setParcels(Parcel... parcels)

      Information regarding the appearance, content, and shipment of a Parcel.

      Parameters:
      parcels - values to be set
    • setParcels

      void setParcels(List<Parcel> parcels)

      Information regarding the appearance, content, and shipment of a Parcel.

      Parameters:
      parcels - values to be set
    • setAddress

      void setAddress(Address address)

      Address to which Parcels are delivered.

      Parameters:
      address - value to be set
    • setCustom

      void setCustom(CustomFields custom)

      Custom Fields of the Delivery.

      Specified by:
      setCustom in interface Customizable<Delivery>
      Parameters:
      custom - 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