Interface DuplicatePriceKeyError
- All Superinterfaces:
ErrorObject
Returned when a Price key conflicts with an existing key.
Keys of Embedded Prices must be unique per ProductVariant.
Example to create an instance using the builder pattern
DuplicatePriceKeyError duplicatePriceKeyError = DuplicatePriceKeyError.builder()
.message("{message}")
.conflictingPrice(conflictingPriceBuilder -> conflictingPriceBuilder)
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for DuplicatePriceKeyError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for DuplicatePriceKeyErrorbuilder
(DuplicatePriceKeyError template) create builder for DuplicatePriceKeyError instancestatic DuplicatePriceKeyError
deepCopy
(DuplicatePriceKeyError template) factory method to create a deep copy of DuplicatePriceKeyError@NotNull String
getCode()
Error identifier.@NotNull @Valid Price
Conflicting Embedded Price.@NotNull String
"Duplicate price key: $priceKey.
static DuplicatePriceKeyError
of()
factory methodstatic DuplicatePriceKeyError
of
(DuplicatePriceKeyError template) factory method to create a shallow copy DuplicatePriceKeyErrorvoid
setConflictingPrice
(Price conflictingPrice) Conflicting Embedded Price.void
setMessage
(String message) "Duplicate price key: $priceKey.
static com.fasterxml.jackson.core.type.TypeReference<DuplicatePriceKeyError>
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
-
DUPLICATE_PRICE_KEY
discriminator value for DuplicatePriceKeyError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"Duplicate price key: $priceKey. The price key must be unique per variant."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getConflictingPrice
Conflicting Embedded Price.
- Returns:
- conflictingPrice
-
setMessage
"Duplicate price key: $priceKey. The price key must be unique per variant."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setConflictingPrice
Conflicting Embedded Price.
- Parameters:
conflictingPrice
- value to be set
-
of
factory method- Returns:
- instance of DuplicatePriceKeyError
-
of
factory method to create a shallow copy DuplicatePriceKeyError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of DuplicatePriceKeyError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for DuplicatePriceKeyError- Returns:
- builder
-
builder
create builder for DuplicatePriceKeyError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withDuplicatePriceKeyError
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
-