Class ValidatorImpl<T>

    • Constructor Detail

      • ValidatorImpl

        public ValidatorImpl​(Class<T> valueClass,
                             Checker<? super T> error,
                             Checker<? super T> warning)
    • Method Detail

      • getValueClass

        public Class<T> getValueClass()
        Specified by:
        getValueClass in interface Validator<T>
        Returns:
        The class of values validated by this validator.
      • explainError

        public String explainError​(String name)
        Description copied from interface: Validator
        Returns an explanation of the rule that must be respected to avoid errors.
        Specified by:
        explainError in interface Validator<T>
        Parameters:
        name - The name that must be given to value in messages.
        Returns:
        An explanation of the rule that must be respected to avoid errors.
      • explainWarning

        public String explainWarning​(String name)
        Description copied from interface: Validator
        Returns an explanation of the rule that must be respected to avoid warnings.
        Specified by:
        explainWarning in interface Validator<T>
        Parameters:
        name - The name that must be given to value in messages.
        Returns:
        An explanation of the rule that must be respected to avoid warnings.
      • validate

        public void validate​(T value,
                             String name,
                             ValidationHandler handler)
        Description copied from interface: Validator
        Validates a value.
        Specified by:
        validate in interface Validator<T>
        Parameters:
        value - The value.
        name - The name that must be given to value in messages.
        handler - The validation messages handler.
      • hasChecker

        public boolean hasChecker​(Validity validity)