com.holonplatform.core.internal

## Class DefaultValidator<T>

- java.lang.Object
- - com.holonplatform.core.internal.DefaultValidator<T>

- Type Parameters:
    `T` - Supported value type
  All Implemented Interfaces:
    Validator<T>, Serializable

      public class DefaultValidator<T>
      extends Object
      implements Validator<T>

  Default `Validator` implementation which uses a `Predicate` as validation operation.
  Since:
    5.0.0
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Validator

      `Validator.PatternFlag, Validator.UnsupportedValidationTypeException, Validator.Validatable<T>, Validator.ValidationException, Validator.ValidationMessage, Validator.ValidatorSupport<T>`

  - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.core.Validator

      `DEFAULT_MESSAGE_CODE_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultValidator(Predicate<T> predicate, Localizable message)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `validate(T value)` Validate given `value`.

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

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

    - ### Methods inherited from interface com.holonplatform.core.Validator

      `create, create, create, digits, digits, digits, email, email, email, future, future, future, greaterOrEqual, greaterOrEqual, greaterOrEqual, greaterThan, greaterThan, greaterThan, in, in, in, isNull, isNull, isNull, lessOrEqual, lessOrEqual, lessOrEqual, lessThan, lessThan, lessThan, max, max, max, min, min, min, notBlank, notBlank, notBlank, notEmpty, notEmpty, notEmpty, notIn, notIn, notIn, notNegative, notNegative, notNegative, notNull, notNull, notNull, notZero, notZero, notZero, past, past, past, pattern, pattern, pattern`

- - ### Constructor Detail

    - #### DefaultValidator

          public DefaultValidator(Predicate<T> predicate,
                                  Localizable message)

  - ### Method Detail

    - #### validate

          public void validate(T value)
                        throws Validator.ValidationException

      Description copied from interface: `Validator`
      Validate given `value`. If the value is not valid, an `Validator.ValidationException` is thrown.

      The `Validator.ValidationException` is `Localizable`, providing optional message code and arguments for validation message localization.

      Specified by:
        `validate` in interface `Validator<T>`
      Parameters:
        `value` - The value to validate (may be null)
      Throws:
        `Validator.ValidationException` - If the value is not valid, providing the validation error message.

Copyright © 2019 The Holon Platform. All rights reserved.