Class Validate


  • public final class Validate
    extends java.lang.Object
    A utility class containing only static methods to quickly check constructor and method arguments.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void isDirectory​(java.nio.file.Path directoryPath, java.lang.String variableName)  
      static void isRegularFile​(java.nio.file.Path filePath, java.lang.String variableName)  
      static void notNull​(java.lang.Object object, java.lang.String variableName)  
      • Methods inherited from class java.lang.Object

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

      • isDirectory

        public static void isDirectory​(java.nio.file.Path directoryPath,
                                       java.lang.String variableName)
        Throws:
        java.lang.IllegalArgumentException - if directoryPath is null or not a directory.
      • isRegularFile

        public static void isRegularFile​(java.nio.file.Path filePath,
                                         java.lang.String variableName)
        Throws:
        java.lang.IllegalArgumentException - if filePath is null or not a regular file.
      • notNull

        public static void notNull​(java.lang.Object object,
                                   java.lang.String variableName)
        Throws:
        java.lang.IllegalArgumentException - if object is null.