Enum Argument.Type

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

    public static enum Argument.Type
    extends java.lang.Enum<Argument.Type>
    An argument type.

    If arg1 is a mandatory argument, -arg2 value2 is a value and -arg3 is a flag, this is an example of a valid command line input:

    program arg1 -arg2 value2 -arg3
    The order of value and flag arguments is irrelevant. Mandatory arguments must occur in the specified order, but they can interleave with other parameters.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      FLAG
      An argument without any value (a flag, e.g.
      MANDATORY
      A mandatory argument.
      VALUE
      An argument with one value (for example -v value).
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Argument.Type valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Argument.Type[] 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

      • MANDATORY

        public static final Argument.Type MANDATORY
        A mandatory argument.
      • VALUE

        public static final Argument.Type VALUE
        An argument with one value (for example -v value).
      • FLAG

        public static final Argument.Type FLAG
        An argument without any value (a flag, e.g. -f).
    • Method Detail

      • values

        public static Argument.Type[] 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 (Argument.Type c : Argument.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Argument.Type 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