Class ValidationUtils


  • public class ValidationUtils
    extends java.lang.Object
    Validation utils for Class objects.
    • Constructor Summary

      Constructors 
      Constructor Description
      ValidationUtils()
      Default constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> void notNull​(T object)
      Validate that the specified argument is not null; otherwise throws an IllegalArgumentException with the specified message.
      static <T> void notNull​(T object, java.lang.String message)
      Validate that the specified argument is not null; otherwise throws an IllegalArgumentException with the specified message.
      <K> void validate​(K k)
      Checks if an object is valid.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValidationUtils

        public ValidationUtils()
        Default constructor.
    • Method Detail

      • notNull

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

        public static <T> void notNull​(T object,
                                       java.lang.String message)
        Validate that the specified argument is not null; otherwise throws an IllegalArgumentException with the specified message.
        Type Parameters:
        T - the object type
        Parameters:
        object - the object to check
        message - the String.format(String, Object...) exception message if invalid, not null
        Throws:
        java.lang.IllegalArgumentException - if the object is null
      • validate

        public final <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