Enum CommandLineParser.Mode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CommandLineParser.Mode>
    Enclosing class:
    CommandLineParser

    protected static enum CommandLineParser.Mode
    extends java.lang.Enum<CommandLineParser.Mode>
    The mode of an argument specifies the type of variable it represents, whether an extra parameter is required after the flag and how to parse it.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOOLEAN
      Argument value is a Boolean.
      ENUM
      Argument value is a String.
      INTEGER
      Argument value is an Integer.
      STRING
      Argument value is a String.
      STRING_ARRAY
      Argument value is a List<String>.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean needsExtra()
      Returns true if this mode requires an extra parameter.
      abstract java.lang.Object process​(CommandLineParser.Arg arg, java.lang.String extra)
      Processes the flag for this argument.
      static CommandLineParser.Mode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CommandLineParser.Mode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • BOOLEAN

        public static final CommandLineParser.Mode BOOLEAN
        Argument value is a Boolean. Default value is a Boolean.
      • INTEGER

        public static final CommandLineParser.Mode INTEGER
        Argument value is an Integer. Default value is an Integer.
      • ENUM

        public static final CommandLineParser.Mode ENUM
        Argument value is a String. Default value is a String[].
      • STRING

        public static final CommandLineParser.Mode STRING
        Argument value is a String. Default value is a null.
      • STRING_ARRAY

        public static final CommandLineParser.Mode STRING_ARRAY
        Argument value is a List<String>. Default value is an empty list.
    • Method Detail

      • values

        public static CommandLineParser.Mode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CommandLineParser.Mode c : CommandLineParser.Mode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CommandLineParser.Mode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • needsExtra

        public abstract boolean needsExtra()
        Returns true if this mode requires an extra parameter.