Interface ComponentVerifierExtension.VerificationError
-
- All Superinterfaces:
Serializable
- Enclosing interface:
- ComponentVerifierExtension
public static interface ComponentVerifierExtension.VerificationError extends Serializable
This interface represents a detailed error in case when the verification fails.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ComponentVerifierExtension.VerificationError.Attribute
Interface defining an attribute which is a key for the detailed error messages.static interface
ComponentVerifierExtension.VerificationError.Code
Interface defining an error code.static interface
ComponentVerifierExtension.VerificationError.ExceptionAttribute
Attributes for details about an exception that was raisedstatic interface
ComponentVerifierExtension.VerificationError.GroupAttribute
Group related detailsstatic interface
ComponentVerifierExtension.VerificationError.HttpAttribute
HTTP related error detailsstatic interface
ComponentVerifierExtension.VerificationError.StandardCode
Standard set of error codes
-
Method Summary
-
-
-
Method Detail
-
getCode
ComponentVerifierExtension.VerificationError.Code 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
Set<String> 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
default Object getDetail(ComponentVerifierExtension.VerificationError.Attribute attribute)
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
default Object getDetail(String attribute)
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
static ComponentVerifierExtension.VerificationError.Code asCode(String code)
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
static ComponentVerifierExtension.VerificationError.Attribute asAttribute(String attribute)
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
-
-