Interface OutOfStockError
- All Superinterfaces:
ErrorObject
Returned when some of the Line Items are out of stock at the time of placing an Order.
The error is returned as a failed response to:
- Create Order from Cart, Create Order in Store from Cart, Create Order from Quote, and Create Order by Import requests on Orders.
- Create Order from Cart, Create Order in Store from Cart, and Create Order from Quote requests on My Orders.
- Create Order from Cart in BusinessUnit and Create Order from Quote in BusinessUnit requests on Associate Orders.
Example to create an instance using the builder pattern
OutOfStockError outOfStockError = OutOfStockError.builder()
.message("{message}")
.plusLineItems(lineItemsBuilder -> lineItemsBuilder)
.plusSkus(skusBuilder -> skusBuilder)
.build()
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OutOfStockErrorBuilder
builder()
builder factory method for OutOfStockErrorstatic OutOfStockErrorBuilder
builder
(OutOfStockError template) create builder for OutOfStockError instancestatic OutOfStockError
deepCopy
(OutOfStockError template) factory method to create a deep copy of OutOfStockError@NotNull String
getCode()
Error identifier.Unique identifiers of the Line Items that are out of stock.@NotNull String
"Some line items are out of stock at the time of placing the order: $itemSku."
getSkus()
SKUs of the Line Items that are out of stock.static OutOfStockError
of()
factory methodstatic OutOfStockError
of
(OutOfStockError template) factory method to create a shallow copy OutOfStockErrorvoid
setLineItems
(String... lineItems) Unique identifiers of the Line Items that are out of stock.void
setLineItems
(List<String> lineItems) Unique identifiers of the Line Items that are out of stock.void
setMessage
(String message) "Some line items are out of stock at the time of placing the order: $itemSku."
void
SKUs of the Line Items that are out of stock.void
SKUs of the Line Items that are out of stock.static com.fasterxml.jackson.core.type.TypeReference<OutOfStockError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withOutOfStockError
(Function<OutOfStockError, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
OUT_OF_STOCK
discriminator value for OutOfStockError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"Some line items are out of stock at the time of placing the order: $itemSku."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getLineItems
Unique identifiers of the Line Items that are out of stock.
- Returns:
- lineItems
-
getSkus
SKUs of the Line Items that are out of stock.
- Returns:
- skus
-
setMessage
"Some line items are out of stock at the time of placing the order: $itemSku."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setLineItems
Unique identifiers of the Line Items that are out of stock.
- Parameters:
lineItems
- values to be set
-
setLineItems
Unique identifiers of the Line Items that are out of stock.
- Parameters:
lineItems
- values to be set
-
setSkus
SKUs of the Line Items that are out of stock.
- Parameters:
skus
- values to be set
-
setSkus
SKUs of the Line Items that are out of stock.
- Parameters:
skus
- values to be set
-
of
factory method- Returns:
- instance of OutOfStockError
-
of
factory method to create a shallow copy OutOfStockError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of OutOfStockError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for OutOfStockError- Returns:
- builder
-
builder
create builder for OutOfStockError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withOutOfStockError
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
-