com.holonplatform.vaadin7.components

## Interface ValidationStatusHandler.ValidationStatusEvent<V>

- Type Parameters:
    `V` - Validation value type
  All Superinterfaces:
    Serializable
  Enclosing interface:
    ValidationStatusHandler

      public static interface ValidationStatusHandler.ValidationStatusEvent<V>
      extends Serializable

  A validation status event.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default Optional<com.holonplatform.core.i18n.Localizable>` | `getError()` Get the first `Localizable` validation error message, if the validation status is `ValidationStatusHandler.Status.INVALID`.
    `default String` | `getErrorMessage()` Get the first localized error message, using the context `LocalizationContext`, if available.
    `default List<String>` | `getErrorMessages()` Get the localized error messages from `getErrors()`, using the context `LocalizationContext`, if available.
    `List<com.holonplatform.core.i18n.Localizable>` | `getErrors()` Get the `Localizable` validation error messages, if the validation status is `ValidationStatusHandler.Status.INVALID`.
    `Optional<com.holonplatform.core.property.Property<V>>` | `getProperty()` If the validation event refers to a `Property` binding, returns the property to which the value component is bound.
    `Optional<ValueComponent<V>>` | `getSource()` Get the `ValueComponent` against whom the validation was performed.
    `ValidationStatusHandler.Status` | `getStatus()` Get the current validation status
    `default boolean` | `isInvalid()` Gets whether the validation failed or not.

- - ### Method Detail

    - #### getStatus

          ValidationStatusHandler.Status getStatus()

      Get the current validation status
      Returns:
        the validation status (never null)

    - #### isInvalid

          default boolean isInvalid()

      Gets whether the validation failed or not.
      Returns:
        `true` if validation failed (i.e. the validation status is `ValidationStatusHandler.Status.INVALID`), `false` otherwise

    - #### getErrors

          List<com.holonplatform.core.i18n.Localizable> getErrors()

      Get the `Localizable` validation error messages, if the validation status is `ValidationStatusHandler.Status.INVALID`.
      Returns:
        the validation error messages when in invalid state, an empty list if none

    - #### getErrorMessages

          default List<String> getErrorMessages()

      Get the localized error messages from `getErrors()`, using the context `LocalizationContext`, if available. If a `LocalizationContext` is not available, the default message of each localizable error message is returned.
      Returns:
        the localized error messages, an empty list if none.

    - #### getError

          default Optional<com.holonplatform.core.i18n.Localizable> getError()

      Get the first `Localizable` validation error message, if the validation status is `ValidationStatusHandler.Status.INVALID`.
      Returns:
        the optional first `Localizable` validation error message when in invalid state

    - #### getErrorMessage

          default String getErrorMessage()

      Get the first localized error message, using the context `LocalizationContext`, if available. If a `LocalizationContext` is not available, the default message of the first localizable error message is returned.
      Returns:
        the first localized error message, or `null` if none

    - #### getProperty

          Optional<com.holonplatform.core.property.Property<V>> getProperty()

      If the validation event refers to a `Property` binding, returns the property to which the value component is bound.
      Returns:
        Optional `Property` to which the value component source of the validation event is bound, empty if no property binding is available

    - #### getSource

          Optional<ValueComponent<V>> getSource()

      Get the `ValueComponent` against whom the validation was performed.
      Returns:
        the source `ValueComponent`, empty if not available

Copyright © 2019 The Holon Platform. All rights reserved.