Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.logging.log4j.core.config.plugins.validation.validators
Class RequiredValidator

    java.lang.Object
      org.apache.logging.log4j.core.config.plugins.validation.validators.RequiredValidator

All Implemented Interfaces:
  ConstraintValidator<Required>

    public class RequiredValidator

extends Object
implements ConstraintValidator<Required>

Validator that checks an object for emptiness. Emptiness is defined here as:

- The value `null`
- An object of type `CharSequence` with length 0
- An empty array
- An empty `Collection`
- An empty `Map`

Since:
  2.1

Constructor Summary
`RequiredValidator()`

Method Summary
`void` | `initialize(Required annotation)` Called before this validator is used with the constraint annotation value.
`boolean` | `isValid(Object value)` Indicates if the given value is valid.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RequiredValidator

    public RequiredValidator()

Method Detail

### initialize

    public void initialize(Required annotation)

  Description copied from interface: `ConstraintValidator`
  Called before this validator is used with the constraint annotation value.

  Specified by:
    `initialize` in interface `ConstraintValidator<Required>`
  Parameters:
    `annotation` - the annotation value this validator will be validating.

### isValid

    public boolean isValid(Object value)

  Description copied from interface: `ConstraintValidator`
  Indicates if the given value is valid.

  Specified by:
    `isValid` in interface `ConstraintValidator<Required>`
  Parameters:
    `value` - the value to validate.
  Returns:
    `true` if the given value is valid.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.