Package org.keycloak.validate
Class ValidationError
- java.lang.Object
-
- org.keycloak.validate.ValidationError
-
- All Implemented Interfaces:
Serializable
public class ValidationError extends Object implements Serializable
Denotes an error found during validation.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
MESSAGE_INVALID_VALUE
A generic invalid value message.
-
Constructor Summary
Constructors Constructor Description ValidationError(String validatorId, String inputHint, String message)
ValidationError(String validatorId, String inputHint, String message, Object... messageParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
formatMessage(BiFunction<String,Object[],String> formatter)
Formats the currentValidationError
with the given formatterFunction
.String
getInputHint()
Object[]
getInputHintWithMessageParameters()
Returns an array where the first element is theinputHint
follwed by themessageParameters
.String
getMessage()
Object[]
getMessageParameters()
Returns the raw message parameters, e.g.javax.ws.rs.core.Response.Status
getStatusCode()
String
getValidatorId()
int
hashCode()
ValidationError
setStatusCode(javax.ws.rs.core.Response.Status statusCode)
String
toString()
-
-
-
Field Detail
-
MESSAGE_INVALID_VALUE
public static final String MESSAGE_INVALID_VALUE
A generic invalid value message.- See Also:
- Constant Field Values
-
-
Method Detail
-
getValidatorId
public String getValidatorId()
-
getInputHint
public String getInputHint()
-
getMessage
public String getMessage()
-
getMessageParameters
public Object[] getMessageParameters()
Returns the raw message parameters, e.g. the actual input that was given for validation.- Returns:
- See Also:
getInputHintWithMessageParameters()
-
formatMessage
public String formatMessage(BiFunction<String,Object[],String> formatter)
Formats the currentValidationError
with the given formatterFunction
.The formatter
Function
will be called with themessage
andgetInputHintWithMessageParameters()
to render the error message.- Parameters:
formatter
-- Returns:
-
getInputHintWithMessageParameters
public Object[] getInputHintWithMessageParameters()
Returns an array where the first element is theinputHint
follwed by themessageParameters
.- Returns:
-
setStatusCode
public ValidationError setStatusCode(javax.ws.rs.core.Response.Status statusCode)
-
getStatusCode
public javax.ws.rs.core.Response.Status getStatusCode()
-
-