Interface Reservation

All Superinterfaces:
BaseResource

public interface Reservation extends BaseResource

A Reservation represents a quantity of inventory that is reserved.


Example to create an instance using the builder pattern

     Reservation reservation = Reservation.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .expiresAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .inventoryEntry(inventoryEntryBuilder -> inventoryEntryBuilder)
             .quantity(0.3)
             .owner(ownerBuilder -> ownerBuilder)
             .lineItemId("{lineItemId}")
             .state(ReservationState.CREATED)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Reservation.

      Specified by:
      getId in interface BaseResource
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the Reservation.

      Specified by:
      getVersion in interface BaseResource
      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the Reservation was initially created.

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Reservation was last updated.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getExpiresAt

      @NotNull @NotNull ZonedDateTime getExpiresAt()

      Date and time (UTC) the Reservation will no longer be valid. It can take a few minutes after expiry for the state to be updated to Expired and the stock to be released.

      Returns:
      expiresAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Reservation.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      IDs and references that created the Reservation.

      Returns:
      createdBy
    • getInventoryEntry

      @NotNull @Valid @NotNull @Valid InventoryEntryReference getInventoryEntry()

      Reference to the related InventoryEntry used to manage the inventory.

      Returns:
      inventoryEntry
    • getQuantity

      @NotNull @NotNull Long getQuantity()

      The quantity of inventory that is reserved.

      Returns:
      quantity
    • getOwner

      @NotNull @Valid @NotNull @Valid Reference getOwner()

      Reference to the owner of the Reservation.

      Returns:
      owner
    • getLineItemId

      @NotNull @NotNull String getLineItemId()

      Unique identifier of the LineItem this Reservation is associated with.

      Returns:
      lineItemId
    • getState

      @NotNull @NotNull ReservationState getState()

      Current state of the Reservation.

      Returns:
      state
    • setId

      void setId(String id)

      Unique identifier of the Reservation.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the Reservation.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the Reservation was initially created.

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Reservation was last updated.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setExpiresAt

      void setExpiresAt(ZonedDateTime expiresAt)

      Date and time (UTC) the Reservation will no longer be valid. It can take a few minutes after expiry for the state to be updated to Expired and the stock to be released.

      Parameters:
      expiresAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Reservation.

      Parameters:
      lastModifiedBy - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      IDs and references that created the Reservation.

      Parameters:
      createdBy - value to be set
    • setInventoryEntry

      void setInventoryEntry(InventoryEntryReference inventoryEntry)

      Reference to the related InventoryEntry used to manage the inventory.

      Parameters:
      inventoryEntry - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      The quantity of inventory that is reserved.

      Parameters:
      quantity - value to be set
    • setOwner

      void setOwner(Reference owner)

      Reference to the owner of the Reservation.

      Parameters:
      owner - value to be set
    • setLineItemId

      void setLineItemId(String lineItemId)

      Unique identifier of the LineItem this Reservation is associated with.

      Parameters:
      lineItemId - value to be set
    • setState

      void setState(ReservationState state)

      Current state of the Reservation.

      Parameters:
      state - value to be set
    • of

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

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

      Reservation copyDeep()
      Specified by:
      copyDeep in interface BaseResource
    • deepCopy

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

      static ReservationBuilder builder()
      builder factory method for Reservation
      Returns:
      builder
    • builder

      static ReservationBuilder builder(Reservation template)
      create builder for Reservation instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withReservation

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