Class ValidationUtils


  • public class ValidationUtils
    extends java.lang.Object
    Utility class for validating CLI options and parameters.
    • Constructor Summary

      Constructors 
      Constructor Description
      ValidationUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void fileMustExist​(java.io.File file, picocli.CommandLine cmdSpec)
      Verifies the file instance exists, otherwise raises a CommandLine.ParameterException.
      static void validWriteMode​(java.lang.String writeMode, picocli.CommandLine cmdSpec)
      Verifies the string writeMode is a valid option, otherwise raises a CommandLine.ParameterException.
      • Methods inherited from class java.lang.Object

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

      • ValidationUtils

        public ValidationUtils()
    • Method Detail

      • validWriteMode

        public static void validWriteMode​(java.lang.String writeMode,
                                          picocli.CommandLine cmdSpec)
        Verifies the string writeMode is a valid option, otherwise raises a CommandLine.ParameterException.
        Parameters:
        writeMode - Value to check.
        cmdSpec - CommandLine instance.
      • fileMustExist

        public static void fileMustExist​(java.io.File file,
                                         picocli.CommandLine cmdSpec)
        Verifies the file instance exists, otherwise raises a CommandLine.ParameterException.
        Parameters:
        file - File to check.
        cmdSpec - CommandLine instance.