Interface StoreCartDiscountsLimitReachedError
- All Superinterfaces:
ErrorObject
- All Known Implementing Classes:
StoreCartDiscountsLimitReachedErrorImpl
Returned when a Cart Discount cannot be created or assigned to a Store as the limit for active Cart Discounts in a Store has been reached for one or more Stores in the request.
The error is returned as a failed response to:
- Create CartDiscount and Create CartDiscount in Store requests
- Add Store and Set Store update actions
Example to create an instance using the builder pattern
StoreCartDiscountsLimitReachedError storeCartDiscountsLimitReachedError = StoreCartDiscountsLimitReachedError.builder()
.message("{message}")
.plusStores(storesBuilder -> storesBuilder)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for StoreCartDiscountsLimitReachedError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for StoreCartDiscountsLimitReachedErrorbuilder
(StoreCartDiscountsLimitReachedError template) create builder for StoreCartDiscountsLimitReachedError instancedeepCopy
(StoreCartDiscountsLimitReachedError template) factory method to create a deep copy of StoreCartDiscountsLimitReachedError@NotNull String
getCode()
Error identifier.@NotNull String
"Maximum number of active cart discounts reached for $stores."
@NotNull @Valid List<StoreKeyReference>
Stores for which the limit for active Cart Discounts that can exist has been reached.of()
factory methodof
(StoreCartDiscountsLimitReachedError template) factory method to create a shallow copy StoreCartDiscountsLimitReachedErrorvoid
setMessage
(String message) "Maximum number of active cart discounts reached for $stores."
void
setStores
(StoreKeyReference... stores) Stores for which the limit for active Cart Discounts that can exist has been reached.void
setStores
(List<StoreKeyReference> stores) Stores for which the limit for active Cart Discounts that can exist has been reached.static com.fasterxml.jackson.core.type.TypeReference<StoreCartDiscountsLimitReachedError>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.error.ErrorObject
setValue, values, withErrorObject
-
Field Details
-
STORE_CART_DISCOUNTS_LIMIT_REACHED
discriminator value for StoreCartDiscountsLimitReachedError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"Maximum number of active cart discounts reached for $stores."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getStores
Stores for which the limit for active Cart Discounts that can exist has been reached.
- Returns:
- stores
-
setMessage
"Maximum number of active cart discounts reached for $stores."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setStores
Stores for which the limit for active Cart Discounts that can exist has been reached.
- Parameters:
stores
- values to be set
-
setStores
Stores for which the limit for active Cart Discounts that can exist has been reached.
- Parameters:
stores
- values to be set
-
of
factory method- Returns:
- instance of StoreCartDiscountsLimitReachedError
-
of
factory method to create a shallow copy StoreCartDiscountsLimitReachedError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static StoreCartDiscountsLimitReachedError deepCopy(@Nullable StoreCartDiscountsLimitReachedError template) factory method to create a deep copy of StoreCartDiscountsLimitReachedError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for StoreCartDiscountsLimitReachedError- Returns:
- builder
-
builder
static StoreCartDiscountsLimitReachedErrorBuilder builder(StoreCartDiscountsLimitReachedError template) create builder for StoreCartDiscountsLimitReachedError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withStoreCartDiscountsLimitReachedError
default <T> T withStoreCartDiscountsLimitReachedError(Function<StoreCartDiscountsLimitReachedError, 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<StoreCartDiscountsLimitReachedError> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-