Interface Validator

  • All Known Implementing Classes:
    ValidatorImpl

    public interface Validator
    Java Bean validation class. It offers the possibility to validate a given Java Bean against a set of defined constraints.
    • Method Detail

      • getConstraintViolations

        <K> Set<javax.validation.ConstraintViolation<Object>> getConstraintViolations​(K k)
        Checks if an object is valid and returns the list of the constraints not met.
        Type Parameters:
        K - the object class
        Parameters:
        k - the object to check
        Returns:
        the list of violated constraints.
      • getConstraintViolationsMessages

        <K> List<String> getConstraintViolationsMessages​(K k)
        Checks if an object is valid and returns the list of the constraints messages not met.
        Type Parameters:
        K - the object class
        Parameters:
        k - the object to check
        Returns:
        the list of violated constraints messages.
      • validate

        <K> void validate​(K k)
        Checks if an object is valid.
        Type Parameters:
        K - the object class
        Parameters:
        k - the object to check
        Throws:
        InvalidBeanException - InvalidBeanException if the validation fails
      • notNull

        static <T> void notNull​(T object)
        Validate that the specified argument is not null; otherwise throws an IllegalArgumentException.
        Type Parameters:
        T - the object type
        Parameters:
        object - the object to check
        Throws:
        IllegalArgumentException - if the object is null