Class ArgumentNotValid

    • Constructor Detail

      • ArgumentNotValid

        public ArgumentNotValid​(String message)
        Constructs new ArgumentNotValid with the specified detail message.
        Parameters:
        message - The detail message
      • ArgumentNotValid

        public ArgumentNotValid​(String message,
                                Throwable cause)
        Constructs new ArgumentNotValid with the specified detail message and cause.
        Parameters:
        message - The detail message
        cause - The cause
    • Method Detail

      • checkNotNullOrEmpty

        public static void checkNotNullOrEmpty​(String val,
                                               String name)
        Check if a String argument is null or the empty string.
        Parameters:
        val - the value to check
        name - the name and type of the value being checked
        Throws:
        ArgumentNotValid - if test fails
      • checkNotNull

        public static void checkNotNull​(Object val,
                                        String name)
        Check if an Object argument is null.
        Parameters:
        val - the value to check
        name - the name and type of the value being checked.
        Throws:
        ArgumentNotValid - if test fails
      • checkNotNegative

        public static void checkNotNegative​(int num,
                                            String name)
        Check if an int argument is less than 0.
        Parameters:
        num - argument to check
        name - the name and type of the value being checked.
        Throws:
        ArgumentNotValid - if test fails
      • checkNotNegative

        public static void checkNotNegative​(long num,
                                            String name)
        Check if a long argument is less than 0.
        Parameters:
        num - argument to check
        name - the name and type of the value being checked.
        Throws:
        ArgumentNotValid - if test fails
      • checkPositive

        public static void checkPositive​(int num,
                                         String name)
        Check if an int argument is less than or equal to 0.
        Parameters:
        num - argument to check
        name - the name and type of the value being checked.
        Throws:
        ArgumentNotValid - if test fails
      • checkPositive

        public static void checkPositive​(long num,
                                         String name)
        Check if a long argument is less than 0.
        Parameters:
        num - argument to check
        name - the name and type of the value being checked.
        Throws:
        ArgumentNotValid - if test fails
      • checkNotNullOrEmpty

        public static void checkNotNullOrEmpty​(Collection<?> c,
                                               String name)
        Check if a List argument is not null and the list is not empty.
        Parameters:
        c - argument to check
        name - the name and type of the value being checked.
        Throws:
        ArgumentNotValid - if test fails
      • checkTrue

        public static void checkTrue​(boolean b,
                                     String s)
        Check that some condition on input parameters is true and throw an ArgumentNotValid if it is false.
        Parameters:
        b - the condition to check
        s - the error message to be reported
        Throws:
        ArgumentNotValid - if b is false
      • checkExistsDirectory

        public static void checkExistsDirectory​(File aDir,
                                                String name)
        Check, if the given argument is an existing directory.
        Parameters:
        aDir - a given File object.
        name - Name of object
        Throws:
        ArgumentNotValid - If aDir is not an existing directory
      • checkExistsNormalFile

        public static void checkExistsNormalFile​(File aFile,
                                                 String name)
        Check, if the given argument is an existing normal file.
        Parameters:
        aFile - a given File object.
        name - Name of object
        Throws:
        ArgumentNotValid - If aDir is not an existing file