org.apache.geode.modules.session.installer.args

## Class Argument

- java.lang.Object
- - org.apache.geode.modules.session.installer.args.Argument

-     public class Argument
      extends java.lang.Object

  Class representing a single command line argument.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Argument(java.lang.String primaryForm, boolean argRequired, java.lang.String... parameterNames)` Contructor to create an argument definition.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Argument` | `addForm(java.lang.String aliasName)` Adds a possible representation of the command line argument.
    `ArgumentHandler` | `getArgumentHandler()` Returns the argument handler.
    `java.lang.String[]` | `getDefaults()` Returns the defaults.
    `java.lang.String` | `getDescription()` Returns a usage description of this argument.
    `java.lang.String[]` | `getEnvVars()` Returns the environment variable names for each parameter.
    `java.util.List<java.lang.String>` | `getForms()` Returns a list of all valid representations of this command line argument.
    `int` | `getParameterCount()` Returns the number of parameters that this argument takes.
    `java.lang.String` | `getParameterName(int idx)` Returns the name of the parameter position requested.
    `java.lang.String` | `getPrimaryForm()` Returns the primary form of the argument.
    `boolean` | `isDefinedInEnv()` Determines if the argument provisioning has been done via the environment.
    `boolean` | `isRequired()` Returns whether or not this argument is required to be defined.
    `Argument` | `setArgumentHandler(ArgumentHandler aHandler)` Sets the argument handler.
    `Argument` | `setDefaults(java.lang.String... newDefaults)` Sets the default values when no explicit values were provided.
    `Argument` | `setDescription(java.lang.String str)` Sets a usage description for this argument.
    `Argument` | `setEnvVars(java.lang.String... newEnvVars)` Sets the environment variables which will be checked for values before falling back on the default values.
    `java.lang.String` | `toString()` Returns a human readable form.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Argument

          public Argument(java.lang.String primaryForm,
                          boolean argRequired,
                          java.lang.String... parameterNames)

      Contructor to create an argument definition.
      Parameters:
        `primaryForm` - the form of the argument (e.g., --foo). Should start with a dash.
        `argRequired` - flag indicating whether or not the argument is required to be onthe command line
        `parameterNames` - names of the parameters to this argument for use in the usage generation

  - ### Method Detail

    - #### getParameterCount

          public int getParameterCount()

      Returns the number of parameters that this argument takes.
      Returns:
        parameter count

    - #### getParameterName

          public java.lang.String getParameterName(int idx)

      Returns the name of the parameter position requested.
      Parameters:
        `idx` - parameter index
      Returns:
        parameter name

    - #### isRequired

          public boolean isRequired()

      Returns whether or not this argument is required to be defined.
      Returns:
        true if required, false if optional

    - #### isDefinedInEnv

          public boolean isDefinedInEnv()

      Determines if the argument provisioning has been done via the environment.

    - #### setArgumentHandler

          public Argument setArgumentHandler(ArgumentHandler aHandler)

      Sets the argument handler.
      Parameters:
        `aHandler` - argument handler
      Returns:
        this argument (for chained calls)

    - #### getArgumentHandler

          public ArgumentHandler getArgumentHandler()

      Returns the argument handler.
      Returns:
        argument handler

    - #### addForm

          public Argument addForm(java.lang.String aliasName)

      Adds a possible representation of the command line argument.
      Parameters:
        `aliasName` - additional form to accept
      Returns:
        this argument (for chained calls)

    - #### getPrimaryForm

          public java.lang.String getPrimaryForm()

      Returns the primary form of the argument.
      Returns:
        primary form

    - #### getForms

          public java.util.List<java.lang.String> getForms()

      Returns a list of all valid representations of this command line argument.
      Returns:
        list of all registered forms

    - #### setDescription

          public Argument setDescription(java.lang.String str)

      Sets a usage description for this argument.
      Parameters:
        `str` - usage description
      Returns:
        this argument (for chained calls)

    - #### getDescription

          public java.lang.String getDescription()

      Returns a usage description of this argument.
      Returns:
        description

    - #### setDefaults

          public Argument setDefaults(java.lang.String... newDefaults)

      Sets the default values when no explicit values were provided.
      Parameters:
        `newDefaults` - default values for all argument parameters
      Returns:
        this argument (for chained calls)

    - #### getDefaults

          public java.lang.String[] getDefaults()

      Returns the defaults.
      Returns:
        default parameter values

    - #### setEnvVars

          public Argument setEnvVars(java.lang.String... newEnvVars)

      Sets the environment variables which will be checked for values before falling back on the default values.
      Parameters:
        `newEnvVars` - environment variable name array
      Returns:
        this argument (for chained calls)

    - #### getEnvVars

          public java.lang.String[] getEnvVars()

      Returns the environment variable names for each parameter.
      Returns:
        environment variable names

    - #### toString

          public java.lang.String toString()

      Returns a human readable form.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        human readable string