Class RequiredValidator

java.lang.Object
com.aquima.interactions.framework.validator.ValidatorBase
com.aquima.interactions.framework.validator.RequiredValidator
All Implemented Interfaces:
IValidator, Serializable

public class RequiredValidator extends ValidatorBase
Validator implementation that checks is a value isn't empty. The following are considered empty, and thus invalid:
  • Any null or UNKNOWN value
  • An empty StringValue. A StringValue containing whitespace characters is not considered empty.
  • Any empty ListValue regardless of type.
Since:
7.1
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • RequiredValidator

      public RequiredValidator(String name)
      Constructs the validator with the definition.
      Parameters:
      name - The name of the validator type.
  • Method Details

    • validate

      public boolean validate(IValue attrValue, IParameters parameters)
      Description copied from interface: IValidator
      This method will be invoked for each value that should be validated by this validator.
      Parameters:
      attrValue - The value that should be validated.
      parameters - The (optional) parameters that can be used during validation.
      Returns:
      Boolean indicating if the value is deemed valid by this validator.