Interface ErrorObject
- All Known Subinterfaces:
AccessDeniedError
,ConcurrentModificationError
,ContentionError
,DuplicateAttributeValueError
,DuplicateAttributeValuesError
,DuplicateFieldError
,DuplicateVariantValuesError
,GenericError
,InsufficientScopeError
,InvalidCredentialsError
,InvalidFieldError
,InvalidFieldsUpdateError
,InvalidInput
,InvalidJsonInput
,InvalidOperation
,InvalidScopeError
,InvalidStateTransitionError
,InvalidTokenError
,NewMasterVariantAdditionNotAllowedError
,RequiredFieldError
,ResourceCreationError
,ResourceDeletionError
,ResourceNotFoundError
,ResourceUpdateError
public interface ErrorObject
Base representation of an error response containing common fields to all errors.
An error response may contain additional fields depending on the type of an error, for example, attribute
in DuplicateAttributeValueError.
Example to create a subtype instance using the builder pattern
ErrorObject errorObject = ErrorObject.accessDeniedBuilder()
message("{message}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic AccessDeniedErrorBuilder
builder for accessDenied subtypebuilder for concurrentModification subtypestatic ContentionErrorBuilder
builder for contention subtypestatic ErrorObject
deepCopy
(ErrorObject template) factory method to create a deep copy of ErrorObjectbuilder for duplicateAttributeValue subtypebuilder for duplicateAttributeValues subtypestatic DuplicateFieldErrorBuilder
builder for duplicateField subtypebuilder for duplicateVariantValues subtypestatic GenericErrorBuilder
builder for generic subtype@NotNull String
getCode()
An error identifier.@NotNull String
A plain language description of the cause of an error.builder for insufficientScope subtypebuilder for invalidCredentials subtypestatic InvalidFieldErrorBuilder
builder for invalidField subtypebuilder for invalidFieldUpdate subtypestatic InvalidInputBuilder
builder for invalidInput subtypestatic InvalidJsonInputBuilder
builder for invalidJsonInput subtypestatic InvalidOperationBuilder
builder for invalidOperation subtypestatic InvalidScopeErrorBuilder
builder for invalidScope subtypestatic InvalidTokenErrorBuilder
builder for invalidToken subtypebuilder for invalidTransition subtypebuilder for newMasterVariantAdditionNotAllowed subtypestatic RequiredFieldErrorBuilder
builder for requiredField subtypestatic ResourceCreationErrorBuilder
builder for resourceCreation subtypestatic ResourceDeletionErrorBuilder
builder for resourceDeletion subtypestatic ResourceNotFoundErrorBuilder
builder for resourceNotFound subtypestatic ResourceUpdateErrorBuilder
builder for resourceUpdate subtypevoid
setMessage
(String message) A plain language description of the cause of an error.static com.fasterxml.jackson.core.type.TypeReference<ErrorObject>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withErrorObject
(Function<ErrorObject, T> helper) accessor map function
-
Method Details
-
getCode
An error identifier.
- Returns:
- code
-
getMessage
A plain language description of the cause of an error.
- Returns:
- message
-
setMessage
A plain language description of the cause of an error.
- Parameters:
message
- value to be set
-
deepCopy
factory method to create a deep copy of ErrorObject- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
accessDeniedBuilder
builder for accessDenied subtype- Returns:
- builder
-
concurrentModificationBuilder
builder for concurrentModification subtype- Returns:
- builder
-
contentionBuilder
builder for contention subtype- Returns:
- builder
-
duplicateAttributeValueBuilder
builder for duplicateAttributeValue subtype- Returns:
- builder
-
duplicateAttributeValuesBuilder
builder for duplicateAttributeValues subtype- Returns:
- builder
-
duplicateFieldBuilder
builder for duplicateField subtype- Returns:
- builder
-
duplicateVariantValuesBuilder
builder for duplicateVariantValues subtype- Returns:
- builder
-
genericBuilder
builder for generic subtype- Returns:
- builder
-
insufficientScopeBuilder
builder for insufficientScope subtype- Returns:
- builder
-
invalidCredentialsBuilder
builder for invalidCredentials subtype- Returns:
- builder
-
invalidFieldBuilder
builder for invalidField subtype- Returns:
- builder
-
invalidFieldUpdateBuilder
builder for invalidFieldUpdate subtype- Returns:
- builder
-
invalidInputBuilder
builder for invalidInput subtype- Returns:
- builder
-
invalidJsonInputBuilder
builder for invalidJsonInput subtype- Returns:
- builder
-
invalidOperationBuilder
builder for invalidOperation subtype- Returns:
- builder
-
invalidScopeBuilder
builder for invalidScope subtype- Returns:
- builder
-
invalidTransitionBuilder
builder for invalidTransition subtype- Returns:
- builder
-
invalidTokenBuilder
builder for invalidToken subtype- Returns:
- builder
-
newMasterVariantAdditionNotAllowedBuilder
builder for newMasterVariantAdditionNotAllowed subtype- Returns:
- builder
-
requiredFieldBuilder
builder for requiredField subtype- Returns:
- builder
-
resourceCreationBuilder
builder for resourceCreation subtype- Returns:
- builder
-
resourceDeletionBuilder
builder for resourceDeletion subtype- Returns:
- builder
-
resourceNotFoundBuilder
builder for resourceNotFound subtype- Returns:
- builder
-
resourceUpdateBuilder
builder for resourceUpdate subtype- Returns:
- builder
-
withErrorObject
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
-