Class Args.DefaultFormat

java.lang.Object
org.omegazero.common.util.Args
org.omegazero.common.util.Args.DefaultFormat
All Implemented Interfaces:
Serializable
Enclosing class:
Args

public static class Args.DefaultFormat extends Args
An Args implementation for the default argument format.
Since:
2.8
See Also:
  • Constructor Details

    • DefaultFormat

      public DefaultFormat()
  • Method Details

    • parseArguments

      public void parseArguments(String[] args)
      Parses the given argument array and stores the data in this Args object.

      Values identified as integers, booleans ("true" and "false") or floating-point numbers are automatically converted to the respective type.

      Arguments are parsed as key-value pairs. A key-value pair consists of a pair of elements in the given array: the first element is -- followed by the key string, the second element is the value string. For example:

       --exampleKey value
       
      The key is "exampleKey" and the value is "value". If a key string such as "--key" has no value (at the end of the array), it is ignored.

      To set a key (for example "key") to the boolean value true, the shorthand "-key" (single dash) may be used.

      Specified by:
      parseArguments in class Args
      Parameters:
      args - The argument array