Interface LineItemQuantityAboveLimitError
- All Superinterfaces:
ErrorObject
Returned when attempting to create or update a Cart with a Line Item whose quantity exceeds the maxCartQuantity limit defined in the InventoryEntry for that Line Item's SKU.
Example to create an instance using the builder pattern
LineItemQuantityAboveLimitError lineItemQuantityAboveLimitError = LineItemQuantityAboveLimitError.builder()
.message("{message}")
.quantity(1)
.maxCartQuantity(1)
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for LineItemQuantityAboveLimitError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for LineItemQuantityAboveLimitErrorbuilder(LineItemQuantityAboveLimitError template) create builder for LineItemQuantityAboveLimitError instancecopyDeep()deepCopy(LineItemQuantityAboveLimitError template) factory method to create a deep copy of LineItemQuantityAboveLimitError@NotNull StringgetCode()Error identifier.Reference to the Line Item that caused the error.@NotNull IntegerThe maximum quantity allowed for this Line Item.@NotNull String"Quantity '$quantity' greater than maximum '$maxCartQuantity'."@NotNull IntegerThe quantity that was requested.of()factory methodof(LineItemQuantityAboveLimitError template) factory method to create a shallow copy LineItemQuantityAboveLimitErrorvoidsetLineItem(String lineItem) Reference to the Line Item that caused the error.voidsetMaxCartQuantity(Integer maxCartQuantity) The maximum quantity allowed for this Line Item.voidsetMessage(String message) "Quantity '$quantity' greater than maximum '$maxCartQuantity'."voidsetQuantity(Integer quantity) The quantity that was requested.static com.fasterxml.jackson.core.type.TypeReference<LineItemQuantityAboveLimitError>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
LINE_ITEM_QUANTITY_ABOVE_LIMIT
discriminator value for LineItemQuantityAboveLimitError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObjectError identifier.
- Specified by:
getCodein interfaceErrorObject- Returns:
- code
-
getMessage
"Quantity '$quantity' greater than maximum '$maxCartQuantity'."- Specified by:
getMessagein interfaceErrorObject- Returns:
- message
-
getQuantity
The quantity that was requested.
- Returns:
- quantity
-
getMaxCartQuantity
The maximum quantity allowed for this Line Item.
- Returns:
- maxCartQuantity
-
getLineItem
String getLineItem()Reference to the Line Item that caused the error.
- Returns:
- lineItem
-
setMessage
"Quantity '$quantity' greater than maximum '$maxCartQuantity'."- Specified by:
setMessagein interfaceErrorObject- Parameters:
message- value to be set
-
setQuantity
The quantity that was requested.
- Parameters:
quantity- value to be set
-
setMaxCartQuantity
The maximum quantity allowed for this Line Item.
- Parameters:
maxCartQuantity- value to be set
-
setLineItem
Reference to the Line Item that caused the error.
- Parameters:
lineItem- value to be set
-
of
factory method- Returns:
- instance of LineItemQuantityAboveLimitError
-
of
factory method to create a shallow copy LineItemQuantityAboveLimitError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
LineItemQuantityAboveLimitError copyDeep()- Specified by:
copyDeepin interfaceErrorObject
-
deepCopy
@Nullable static LineItemQuantityAboveLimitError deepCopy(@Nullable LineItemQuantityAboveLimitError template) factory method to create a deep copy of LineItemQuantityAboveLimitError- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for LineItemQuantityAboveLimitError- Returns:
- builder
-
builder
create builder for LineItemQuantityAboveLimitError instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withLineItemQuantityAboveLimitError
default <T> T withLineItemQuantityAboveLimitError(Function<LineItemQuantityAboveLimitError, 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<LineItemQuantityAboveLimitError> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-