Interface ValueValidator<M,​V>


  • public interface ValueValidator<M,​V>
    Validates the value.
    Author:
    Daniel Sagenschneider
    • Method Detail

      • notNull

        static <M,​V> ValueValidator<M,​V> notNull​(java.lang.String errorMessage)
        Convenience ValueValidator for ensuring not null.
        Type Parameters:
        M - Model type.
        V - Value type.
        Parameters:
        errorMessage - Error message if null.
        Returns:
        ValueValidator to validate not null.
      • notEmptyString

        static <M> ValueValidator<M,​java.lang.String> notEmptyString​(java.lang.String errorMessage)
        Convenience ValueValidator for ensuring not an empty String.
        Type Parameters:
        M - Model type.
        Parameters:
        errorMessage - Error message if empty String.
        Returns:
        ValueValidator to validate not an empty String.
      • notEmptyString

        static void notEmptyString​(java.lang.String value,
                                   java.lang.String errorMessage,
                                   ValueValidator.ValueValidatorContext<?,​?> context)
        Convenience method to provide error if value is empty string.
        Parameters:
        value - Value to check for empty string.
        errorMessage - Error message if empty string.
        context - ValueValidator.ValueValidatorContext.