Interface Reservation
- All Superinterfaces:
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 Summary
Modifier and TypeMethodDescriptionstatic ReservationBuilderbuilder()builder factory method for Reservationstatic ReservationBuilderbuilder(Reservation template) create builder for Reservation instancecopyDeep()static ReservationdeepCopy(Reservation template) factory method to create a deep copy of Reservation@NotNull ZonedDateTimeDate and time (UTC) the Reservation was initially created.@Valid CreatedByIDs and references that created the Reservation.@NotNull ZonedDateTimeDate and time (UTC) the Reservation will no longer be valid.@NotNull StringgetId()Unique identifier of the Reservation.@NotNull @Valid InventoryEntryReferenceReference to the related InventoryEntry used to manage the inventory.@NotNull ZonedDateTimeDate and time (UTC) the Reservation was last updated.@Valid LastModifiedByIDs and references that last modified the Reservation.@NotNull StringUnique identifier of the LineItem this Reservation is associated with.@NotNull @Valid ReferencegetOwner()Reference to the owner of the Reservation.@NotNull LongThe quantity of inventory that is reserved.@NotNull ReservationStategetState()Current state of the Reservation.@NotNull LongCurrent version of the Reservation.static Reservationof()factory methodstatic Reservationof(Reservation template) factory method to create a shallow copy ReservationvoidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Reservation was initially created.voidsetCreatedBy(CreatedBy createdBy) IDs and references that created the Reservation.voidsetExpiresAt(ZonedDateTime expiresAt) Date and time (UTC) the Reservation will no longer be valid.voidUnique identifier of the Reservation.voidsetInventoryEntry(InventoryEntryReference inventoryEntry) Reference to the related InventoryEntry used to manage the inventory.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the Reservation was last updated.voidsetLastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the Reservation.voidsetLineItemId(String lineItemId) Unique identifier of the LineItem this Reservation is associated with.voidReference to the owner of the Reservation.voidsetQuantity(Long quantity) The quantity of inventory that is reserved.voidsetState(ReservationState state) Current state of the Reservation.voidsetVersion(Long version) Current version of the Reservation.static com.fasterxml.jackson.core.type.TypeReference<Reservation>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithReservation(Function<Reservation, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
-
Method Details
-
getId
Unique identifier of the Reservation.
- Specified by:
getIdin interfaceBaseResource- Returns:
- id
-
getVersion
Current version of the Reservation.
- Specified by:
getVersionin interfaceBaseResource- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Reservation was initially created.
- Specified by:
getCreatedAtin interfaceBaseResource- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Reservation was last updated.
- Specified by:
getLastModifiedAtin interfaceBaseResource- Returns:
- lastModifiedAt
-
getExpiresAt
Date and time (UTC) the Reservation will no longer be valid. It can take a few minutes after expiry for the
stateto be updated toExpiredand the stock to be released.- Returns:
- expiresAt
-
getLastModifiedBy
IDs and references that last modified the Reservation.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Reservation.
- Returns:
- createdBy
-
getInventoryEntry
Reference to the related InventoryEntry used to manage the inventory.
- Returns:
- inventoryEntry
-
getQuantity
The quantity of inventory that is reserved.
- Returns:
- quantity
-
getOwner
Reference to the owner of the Reservation.
- Returns:
- owner
-
getLineItemId
Unique identifier of the LineItem this Reservation is associated with.
- Returns:
- lineItemId
-
getState
Current state of the Reservation.
- Returns:
- state
-
setId
Unique identifier of the Reservation.
- Specified by:
setIdin interfaceBaseResource- Parameters:
id- value to be set
-
setVersion
Current version of the Reservation.
- Specified by:
setVersionin interfaceBaseResource- Parameters:
version- value to be set
-
setCreatedAt
Date and time (UTC) the Reservation was initially created.
- Specified by:
setCreatedAtin interfaceBaseResource- Parameters:
createdAt- value to be set
-
setLastModifiedAt
Date and time (UTC) the Reservation was last updated.
- Specified by:
setLastModifiedAtin interfaceBaseResource- Parameters:
lastModifiedAt- value to be set
-
setExpiresAt
Date and time (UTC) the Reservation will no longer be valid. It can take a few minutes after expiry for the
stateto be updated toExpiredand the stock to be released.- Parameters:
expiresAt- value to be set
-
setLastModifiedBy
IDs and references that last modified the Reservation.
- Parameters:
lastModifiedBy- value to be set
-
setCreatedBy
IDs and references that created the Reservation.
- Parameters:
createdBy- value to be set
-
setInventoryEntry
Reference to the related InventoryEntry used to manage the inventory.
- Parameters:
inventoryEntry- value to be set
-
setQuantity
The quantity of inventory that is reserved.
- Parameters:
quantity- value to be set
-
setOwner
Reference to the owner of the Reservation.
- Parameters:
owner- value to be set
-
setLineItemId
Unique identifier of the LineItem this Reservation is associated with.
- Parameters:
lineItemId- value to be set
-
setState
Current state of the Reservation.
- Parameters:
state- value to be set
-
of
factory method- Returns:
- instance of Reservation
-
of
factory method to create a shallow copy Reservation- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
Reservation copyDeep()- Specified by:
copyDeepin interfaceBaseResource
-
deepCopy
factory method to create a deep copy of Reservation- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for Reservation- Returns:
- builder
-
builder
create builder for Reservation instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withReservation
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
-