Class PositionalArguments

All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class PositionalArguments extends TypedProperties
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • PositionalArguments

      public PositionalArguments()
  • Method Details

    • printUsage

      public PositionalArguments printUsage()
      Print usage of the arguments.
      Returns:
      this object.
    • parseArguments

      public PositionalArguments parseArguments(String... clArgs) throws Exception
      Parse the specified command line arguments.
      Parameters:
      clArgs - the arguments to parse.
      Returns:
      this object.
      Throws:
      Exception - if any error occurs.
    • getString

      public String getString(int position)
      Get the value of the argument at the specified position.
      Parameters:
      position - the posiiton of the argument ot lookup.
      Returns:
      the argument value, or null if it is not found.
    • addArg

      public PositionalArguments addArg(String name, String usage)
      Add a new argument with an explicit value.
      Parameters:
      name - the name of the argument.
      usage - a string describing the argument's usage.
      Returns:
      return this object.
    • getTitle

      public String getTitle()
      Get the title diaplayed in the printUsage() method.
      Returns:
      the title as a string.
    • setTitle

      public PositionalArguments setTitle(String title)
      Set the title diaplayed in the printUsage() method.
      Parameters:
      title - the title as a string.
      Returns:
      this object.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractTypedProperties