Interface ConcurrentModificationError
- All Superinterfaces:
ErrorObject
Returned when the request conflicts with the current state of the involved resources. Typically, the request attempts to modify a resource that is out of date (that is modified by another client since it was last retrieved). The client application should resolve the conflict (with or without involving the end user) before retrying the request.
Example to create an instance using the builder pattern
ConcurrentModificationError concurrentModificationError = ConcurrentModificationError.builder()
.message("{message}")
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for ConcurrentModificationError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for ConcurrentModificationErrorbuilder
(ConcurrentModificationError template) create builder for ConcurrentModificationError instancestatic ConcurrentModificationError
deepCopy
(ConcurrentModificationError template) factory method to create a deep copy of ConcurrentModificationError@NotNull String
getCode()
Error identifier.Current version of the resource.@NotNull String
"Object $resourceId has a different version than expected.
static ConcurrentModificationError
of()
factory methodstatic ConcurrentModificationError
of
(ConcurrentModificationError template) factory method to create a shallow copy ConcurrentModificationErrorvoid
setCurrentVersion
(Long currentVersion) Current version of the resource.void
setMessage
(String message) "Object $resourceId has a different version than expected.
static com.fasterxml.jackson.core.type.TypeReference<ConcurrentModificationError>
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
-
CONCURRENT_MODIFICATION
discriminator value for ConcurrentModificationError- See Also:
-
-
Method Details
-
getCode
Description copied from interface:ErrorObject
Error identifier.
- Specified by:
getCode
in interfaceErrorObject
- Returns:
- code
-
getMessage
"Object $resourceId has a different version than expected. Expected: $expectedVersion - Actual: $currentVersion."
- Specified by:
getMessage
in interfaceErrorObject
- Returns:
- message
-
getCurrentVersion
Long getCurrentVersion()Current version of the resource.
- Returns:
- currentVersion
-
setMessage
"Object $resourceId has a different version than expected. Expected: $expectedVersion - Actual: $currentVersion."
- Specified by:
setMessage
in interfaceErrorObject
- Parameters:
message
- value to be set
-
setCurrentVersion
Current version of the resource.
- Parameters:
currentVersion
- value to be set
-
of
factory method- Returns:
- instance of ConcurrentModificationError
-
of
factory method to create a shallow copy ConcurrentModificationError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static ConcurrentModificationError deepCopy(@Nullable ConcurrentModificationError template) factory method to create a deep copy of ConcurrentModificationError- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ConcurrentModificationError- Returns:
- builder
-
builder
create builder for ConcurrentModificationError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withConcurrentModificationError
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
-