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:
Since:
2.1
  • Constructor Details

    • RequiredValidator

      public RequiredValidator()
  • Method Details

    • initialize

      public void initialize(Required anAnnotation)
      Description copied from interface: ConstraintValidator
      Called before this validator is used with the constraint annotation value.
      Specified by:
      initialize in interface ConstraintValidator<Required>
      Parameters:
      anAnnotation - the annotation value this validator will be validating.
    • isValid

      public boolean isValid(String name, Object value)
      Description copied from interface: ConstraintValidator
      Indicates if the given value is valid.
      Specified by:
      isValid in interface ConstraintValidator<Required>
      Parameters:
      name - the name to use for error reporting
      value - the value to validate.
      Returns:
      true if the given value is valid.