org.keycloak.userprofile

## Class ValidationException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.keycloak.userprofile.ValidationException

- All Implemented Interfaces:
    Serializable, Consumer<ValidationError>

      public final class ValidationException
      extends RuntimeException
      implements Consumer<ValidationError>

  Author:
    Pedro Igor
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ValidationException.Error`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValidationException(KeycloakSession session, UserModel user)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `accept(ValidationError error)`
    `List<ValidationException.Error>` | `getErrors()`
    `String` | `getMessage()`
    `javax.ws.rs.core.Response.Status` | `getStatusCode()`
    `boolean` | `hasError(String... types)`
    `boolean` | `isAttributeOnError(String... name)` Checks if there are validation errors related to the attribute with the given `name`.
    `String` | `toString()`

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

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

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

    - ### Methods inherited from interface java.util.function.Consumer

      `andThen`

- - ### Constructor Detail

    - #### ValidationException

          public ValidationException(KeycloakSession session,
                                     UserModel user)

  - ### Method Detail

    - #### getErrors

          public List<ValidationException.Error> getErrors()

    - #### hasError

          public boolean hasError(String... types)

    - #### isAttributeOnError

          public boolean isAttributeOnError(String... name)

      Checks if there are validation errors related to the attribute with the given `name`.
      Parameters:
        `name` -
      Returns:

    - #### accept

          public void accept(ValidationError error)

      Specified by:
        `accept` in interface `Consumer<ValidationError>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Throwable`

    - #### getMessage

          public String getMessage()

      Overrides:
        `getMessage` in class `Throwable`

    - #### getStatusCode

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

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