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 and Description
    --- | ---
    `static String` | `MESSAGE_INVALID_VALUE` A generic invalid value message.

  - ### Constructor Summary

    Constructors
    Constructor and 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 and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `formatMessage(BiFunction<String,Object[],String> formatter)` Formats the current `ValidationError` with the given formatter `Function`.
    `String` | `getInputHint()`
    `Object[]` | `getInputHintWithMessageParameters()` Returns an array where the first element is the `inputHint` follwed by the `messageParameters`.
    `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()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### MESSAGE_INVALID_VALUE

          public static final String MESSAGE_INVALID_VALUE

      A generic invalid value message.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ValidationError

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

    - #### ValidationError

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

  - ### 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 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(javax.ws.rs.core.Response.Status statusCode)

    - #### getStatusCode

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

Copyright © 2021 JBoss by Red Hat. All rights reserved.