Class Validate


  • public final class Validate
    extends java.lang.Object
    Validate Validation utility
    Version:
    $Revision: $
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Validate()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void notNull​(java.lang.Object obj, java.lang.String message)
      Checks that object is not null, throws exception if it is.
      static void notNullAndNoNullValues​(java.lang.Object[] objects, java.lang.String message)
      Checks that the specified array is not null or contain any null values.
      static void notNullOrEmpty​(java.lang.String string, java.lang.String message)
      Checks that the specified String is not null or empty, throws exception if it is.
      • Methods inherited from class java.lang.Object

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

      • Validate

        private Validate()
    • Method Detail

      • notNull

        public static void notNull​(java.lang.Object obj,
                                   java.lang.String message)
                            throws java.lang.IllegalArgumentException
        Checks that object is not null, throws exception if it is.
        Parameters:
        obj - The object to check
        message - The exception message
        Throws:
        java.lang.IllegalArgumentException - Thrown if obj is null
      • notNullOrEmpty

        public static void notNullOrEmpty​(java.lang.String string,
                                          java.lang.String message)
                                   throws java.lang.IllegalArgumentException
        Checks that the specified String is not null or empty, throws exception if it is.
        Parameters:
        string - The object to check
        message - The exception message
        Throws:
        java.lang.IllegalArgumentException - Thrown if obj is null
      • notNullAndNoNullValues

        public static void notNullAndNoNullValues​(java.lang.Object[] objects,
                                                  java.lang.String message)
        Checks that the specified array is not null or contain any null values.
        Parameters:
        objects - The object to check
        message - The exception message