org.keycloak.validation

## Class DefaultValidationContext<T>

- java.lang.Object
- - org.keycloak.validation.DefaultValidationContext<T>

- All Implemented Interfaces:
    ValidationContext<T>
  Direct Known Subclasses:
    ClientValidationContext

      public abstract class DefaultValidationContext<T>
      extends Object
      implements ValidationContext<T>

  Author:
    Vaclav Muzikar

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.validation.ValidationContext

      `ValidationContext.Event`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultValidationContext(ValidationContext.Event event, KeycloakSession session, T objectToValidate)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ValidationContext<T>` | `addError(String message)`
    `ValidationContext<T>` | `addError(String fieldId, String message)`
    `ValidationContext<T>` | `addError(String fieldId, String message, String localizedMessageKey, Object... localizedMessageParams)`
    `ValidationContext.Event` | `getEvent()`
    `T` | `getObjectToValidate()`
    `KeycloakSession` | `getSession()`
    `ValidationResult` | `toResult()`

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

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

- - ### Constructor Detail

    - #### DefaultValidationContext

          public DefaultValidationContext(ValidationContext.Event event,
                                          KeycloakSession session,
                                          T objectToValidate)

  - ### Method Detail

    - #### getEvent

          public ValidationContext.Event getEvent()

      Specified by:
        `getEvent` in interface `ValidationContext<T>`

    - #### getSession

          public KeycloakSession getSession()

      Specified by:
        `getSession` in interface `ValidationContext<T>`

    - #### getObjectToValidate

          public T getObjectToValidate()

      Specified by:
        `getObjectToValidate` in interface `ValidationContext<T>`

    - #### addError

          public ValidationContext<T> addError(String message)

      Specified by:
        `addError` in interface `ValidationContext<T>`

    - #### addError

          public ValidationContext<T> addError(String fieldId,
                                               String message)

      Specified by:
        `addError` in interface `ValidationContext<T>`

    - #### addError

          public ValidationContext<T> addError(String fieldId,
                                               String message,
                                               String localizedMessageKey,
                                               Object... localizedMessageParams)

      Specified by:
        `addError` in interface `ValidationContext<T>`

    - #### toResult

          public ValidationResult toResult()

      Specified by:
        `toResult` in interface `ValidationContext<T>`

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