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:
  • Field Details

    • MESSAGE_INVALID_VALUE

      public static final String MESSAGE_INVALID_VALUE
      A generic invalid value message.
      See Also:
  • Constructor Details

    • ValidationError

      public ValidationError(String validatorId, String inputHint, String message)
    • ValidationError

      public ValidationError(String validatorId, String inputHint, String message, Object... messageParameters)
  • Method Details

    • 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:
    • formatMessage

      public String formatMessage(BiFunction<String,Object[],String> formatter)
      Formats the current ValidationError with the given formatter Function.

      The formatter Function will be called with the message and getInputHintWithMessageParameters() to render the error message.

      Parameters:
      formatter -
      Returns:
    • getInputHintWithMessageParameters

      public Object[] getInputHintWithMessageParameters()
      Returns an array where the first element is the inputHint follwed by the messageParameters.
      Returns:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setStatusCode

      public ValidationError setStatusCode(jakarta.ws.rs.core.Response.Status statusCode)
    • getStatusCode

      public jakarta.ws.rs.core.Response.Status getStatusCode()