Interface ComponentVerifierExtension.VerificationError
- All Superinterfaces:
Serializable
- Enclosing interface:
ComponentVerifierExtension
This interface represents a detailed error in case when the verification fails.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Interface defining an attribute which is a key for the detailed error messages.static interface
Interface defining an error code.static interface
Attributes for details about an exception that was raisedstatic interface
Group related detailsstatic interface
HTTP related error detailsstatic interface
Standard set of error codes -
Method Summary
Modifier and TypeMethodDescriptionasAttribute
(String attribute) Convert a string to anComponentVerifierExtension.VerificationError.Attribute
Convert a string to anComponentVerifierExtension.VerificationError.Code
getCode()
The overall error code, which can be either aComponentVerifierExtension.VerificationError.StandardCode
or a custom code.A human readable description of the error in plain englishdefault Object
Get a single detail for a given attributedefault Object
Get a single detail for a given attributeDetails about the failed verification.A set of input parameter names which fails the verification.
-
Method Details
-
getCode
The overall error code, which can be either aComponentVerifierExtension.VerificationError.StandardCode
or a custom code. It is recommended to stick to the predefined standard codes- Returns:
- the general error code.
-
getDescription
String getDescription()A human readable description of the error in plain english- Returns:
- the error description (if available)
-
getParameterKeys
A set of input parameter names which fails the verification. These are keys to the parameter provided toComponentVerifierExtension.verify(ComponentVerifierExtension.Scope, Map)
.- Returns:
- the parameter names which are malformed and caused the failure of the validation
-
getDetails
Map<ComponentVerifierExtension.VerificationError.Attribute,Object> getDetails()Details about the failed verification. The keys can be either predefined values (ComponentVerifierExtension.VerificationError.ExceptionAttribute
,ComponentVerifierExtension.VerificationError.HttpAttribute
,ComponentVerifierExtension.VerificationError.GroupAttribute
) or it can be free-form custom keys specific to a component. The standard attributes are defined as enums in all uppercase (with underscore as separator), custom attributes are supposed to be in all lower case (also with underscores as separators)- Returns:
- a number of key/value pair with additional information related to the verification.
-
getDetail
Get a single detail for a given attribute- Parameters:
attribute
- the attribute to lookup- Returns:
- the detail value or null if no such attribute exists
-
getDetail
Get a single detail for a given attribute- Parameters:
attribute
- the attribute to lookup- Returns:
- the detail value or null if no such attribute exists
-
asCode
Convert a string to anComponentVerifierExtension.VerificationError.Code
- Parameters:
code
- the code to convert. It should be in all lower case (with underscore as a separator) to avoid overlap withComponentVerifierExtension.VerificationError.StandardCode
- Returns:
- error code
-
asAttribute
Convert a string to anComponentVerifierExtension.VerificationError.Attribute
- Parameters:
attribute
- the string representation of an attribute to convert. It should be in all lower case (with underscore as a separator) to avoid overlap with standard attributes likeComponentVerifierExtension.VerificationError.ExceptionAttribute
,ComponentVerifierExtension.VerificationError.HttpAttribute
orComponentVerifierExtension.VerificationError.GroupAttribute
- Returns:
- generated attribute
-