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
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for ConcurrentModificationError -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for ConcurrentModificationErrorbuilder(ConcurrentModificationError template) create builder for ConcurrentModificationError instancecopyDeep()static ConcurrentModificationErrordeepCopy(ConcurrentModificationError template) factory method to create a deep copy of ConcurrentModificationError@NotNull StringgetCode()Error identifier.Current version of the resource.@NotNull String"Object $resourceId has a different version than expected.static ConcurrentModificationErrorof()factory methodstatic ConcurrentModificationErrorof(ConcurrentModificationError template) factory method to create a shallow copy ConcurrentModificationErrorvoidsetCurrentVersion(Long currentVersion) Current version of the resource.voidsetMessage(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> Taccessor 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:ErrorObjectError identifier.
- Specified by:
getCodein interfaceErrorObject- Returns:
- code
-
getMessage
"Object $resourceId has a different version than expected. Expected: $expectedVersion - Actual: $currentVersion."- Specified by:
getMessagein 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:
setMessagein 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
-
copyDeep
ConcurrentModificationError copyDeep()- Specified by:
copyDeepin interfaceErrorObject
-
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
-