io.vertx.core.cli

## Interface CommandLine

-     public interface CommandLine

  The parser transforms a CLI (a model) into an `CommandLine`. This `CommandLine` has stored the argument and option values. Only instance of parser should create objects of this type.
  Author:
    Clement Escoffier

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `acceptMoreValues(Option option)` Checks whether or not the given option accept more values.
    `List<String>` | `allArguments()`
    `CLI` | `cli()`
    `static CommandLine` | `create(CLI cli)` Creates a command line object from the `CLI`.
    `<T> T` | `getArgumentValue(int index)` Gets the value of an argument with the given index.
    `<T> T` | `getArgumentValue(String name)` Gets the value of an argument with the matching name (arg name).
    `<T> List<T>` | `getArgumentValues(int index)` Gets the values of an argument with the matching index.
    `<T> T` | `getOptionValue(String name)` Gets the value of an option with the matching name (can be the long name, short name or arg name).
    `<T> List<T>` | `getOptionValues(String name)` Gets the values of an option with the matching name (can be the long name, short name or arg name).
    `String` | `getRawValueForArgument(Argument arg)` Gets the raw value of the given argument.
    `String` | `getRawValueForOption(Option option)` Gets the raw value of the given option.
    `default List<String>` | `getRawValues(Option option)` Deprecated. use `getRawValuesForOption(Option)`
    `List<String>` | `getRawValuesForArgument(Argument argument)` Gets the raw values of the given argument.
    `List<String>` | `getRawValuesForOption(Option option)` Gets the raw values of the given option.
    `boolean` | `isArgumentAssigned(Argument arg)` Checks whether or not the given argument has been assigned in the command line.
    `boolean` | `isAskingForHelp()` Checks whether or not the user has passed a "help" option and is asking for help.
    `boolean` | `isFlagEnabled(String name)` Gets the value of an option marked as a flag.
    `boolean` | `isOptionAssigned(Option option)` Checks whether or not the given option has been assigned in the command line.
    `boolean` | `isSeenInCommandLine(Option option)` Checks whether or not the given option has been seen in the user command line.
    `boolean` | `isValid()` Checks whether or not the command line is valid, i.e.

- - ### Method Detail

    - #### create

          static CommandLine create(CLI cli)

      Creates a command line object from the `CLI`. This object is intended to be used by the parser to set the argument and option values.
      Parameters:
        `cli` - the CLI definition
      Returns:
        the command line object

    - #### cli

          CLI cli()

      Returns:
        the model of this command line object.

    - #### allArguments

          List<String> allArguments()

      Returns:
        the ordered list of arguments. Arguments are command line arguments not matching an option.

    - #### getOptionValue

          <T> T getOptionValue(String name)

      Gets the value of an option with the matching name (can be the long name, short name or arg name).
      Type Parameters:
        `T` - the expected type
      Parameters:
        `name` - the name
      Returns:
        the value, `null` if not set

    - #### getArgumentValue

          <T> T getArgumentValue(String name)

      Gets the value of an argument with the matching name (arg name).
      Type Parameters:
        `T` - the expected type
      Parameters:
        `name` - the name
      Returns:
        the value, `null` if not set

    - #### getArgumentValue

          <T> T getArgumentValue(int index)

      Gets the value of an argument with the given index.
      Type Parameters:
        `T` - the expected type
      Parameters:
        `index` - the index
      Returns:
        the value, `null` if not set

    - #### getOptionValues

          <T> List<T> getOptionValues(String name)

      Gets the values of an option with the matching name (can be the long name, short name or arg name).
      Type Parameters:
        `T` - the expected component type
      Parameters:
        `name` - the name
      Returns:
        the values, `null` if not set
      See Also:
        `getRawValuesForOption(Option)`

    - #### getArgumentValues

          <T> List<T> getArgumentValues(int index)

      Gets the values of an argument with the matching index.
      Type Parameters:
        `T` - the expected component type
      Parameters:
        `index` - the index
      Returns:
        the values, `null` if not set
      See Also:
        `getArgumentValue(int)`, `getRawValueForArgument(Argument)`

    - #### isFlagEnabled

          boolean isFlagEnabled(String name)

      Gets the value of an option marked as a flag.

      Calling this method an a non-flag option throws an `IllegalStateException`.
      Parameters:
        `name` - the option name
      Returns:
        `true` if the flag has been set in the command line, `false` otherwise.

    - #### isOptionAssigned

          boolean isOptionAssigned(Option option)

      Checks whether or not the given option has been assigned in the command line.
      Parameters:
        `option` - the option
      Returns:
        `true` if the option has received a value, `false` otherwise.

    - #### getRawValues

          @Deprecated
          default List<String> getRawValues(Option option)

      Deprecated. use `getRawValuesForOption(Option)`
      Gets the raw values of the given option. Raw values are simple "String", not converted to the option type.
      Parameters:
        `option` - the option
      Returns:
        the list of values, empty if none

    - #### getRawValuesForOption

          List<String> getRawValuesForOption(Option option)

      Gets the raw values of the given option. Raw values are simple "String", not converted to the option type.
      Parameters:
        `option` - the option
      Returns:
        the list of values, empty if none

    - #### getRawValuesForArgument

          List<String> getRawValuesForArgument(Argument argument)

      Gets the raw values of the given argument. Raw values are simple "String", not converted to the argument type.
      Parameters:
        `argument` - the argument
      Returns:
        the list of values, empty if none

    - #### getRawValueForOption

          String getRawValueForOption(Option option)

      Gets the raw value of the given option. Raw values are the values as given in the user command line.
      Parameters:
        `option` - the option
      Returns:
        the value, `null` if none.

    - #### acceptMoreValues

          boolean acceptMoreValues(Option option)

      Checks whether or not the given option accept more values.
      Parameters:
        `option` - the option
      Returns:
        `true` if the option accepts more values, `false` otherwise.

    - #### getRawValueForArgument

          String getRawValueForArgument(Argument arg)

      Gets the raw value of the given argument. Raw values are the values as given in the user command line.
      Parameters:
        `arg` - the argument
      Returns:
        the value, `null` if none.

    - #### isArgumentAssigned

          boolean isArgumentAssigned(Argument arg)

      Checks whether or not the given argument has been assigned in the command line.
      Parameters:
        `arg` - the argument
      Returns:
        `true` if the argument has received a value, `false` otherwise.

    - #### isSeenInCommandLine

          boolean isSeenInCommandLine(Option option)

      Checks whether or not the given option has been seen in the user command line.
      Parameters:
        `option` - the option
      Returns:
        `true` if the user command line has used the option

    - #### isValid

          boolean isValid()

      Checks whether or not the command line is valid, i.e. all constraints from arguments and options have been satisfied. This method is used when the parser validation is disabled.
      Returns:
        `true` if the current `CommandLine` object is valid. `false` otherwise.

    - #### isAskingForHelp

          boolean isAskingForHelp()

      Checks whether or not the user has passed a "help" option and is asking for help.
      Returns:
        `true` if the user command line has enabled a "Help" option, `false` otherwise.

Copyright © 2017. All rights reserved.