Interface Validator

All Known Implementing Classes:
AbstractNumberValidator, AbstractValidator, LengthValidator, Not0Validator, PositiveValidator, RangeValidator, RegexValidator

public interface Validator
Interface for value validators.
  • Method Summary

    Modifier and Type
    Method
    Description
    validate(Object value, String param, String msg, boolean negate)
    Validate a value.
  • Method Details

    • validate

      String validate(Object value, String param, String msg, boolean negate)
      Validate a value. The converted value will be passed to this method.
      Parameters:
      value - The value to be validated.
      param - The parameter passed to the validator.
      msg - The custom error message or null, if none was specified.
      negate - true, if the validation should be negated.
      Returns:
      An error message (where '{1}' denotes where to put a description of the element) or null, if the value is valid.