CLOption (Apache JMeter dist API)
Description: declaration: package: org.apache.commons.cli.avalon, class: CLOption

Package org.apache.commons.cli.avalon

# Class CLOption

java.lang.Object
org.apache.commons.cli.avalon.CLOption

public final class CLOption extends Object
Basic class describing an instance of option.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `TEXT_ARGUMENT`
  Value of `CLOptionDescriptor.getId()` when the option is a text argument.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CLOption(String argument)`
  Constructor taking argument for option.
  `CLOption(CLOptionDescriptor descriptor)`
  Constructor taking an descriptor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `addArgument(String argument)`
  Mutator of Argument property.
  `final String`
  `getArgument()`
  Retrieve argument to option if it takes arguments.
  `final String`
  `getArgument(int index)`
  Retrieve indexed argument to option if it takes arguments.
  `final int`
  `getArgumentCount()`
  Get number of arguments.
  `final CLOptionDescriptor`
  `getDescriptor()`
  `final String`
  `toString()`
  Convert to String.

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

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

- ## Field Details

  - ### TEXT_ARGUMENT

    public static final int TEXT_ARGUMENT
    Value of `CLOptionDescriptor.getId()` when the option is a text argument.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### CLOption

    public CLOption(CLOptionDescriptor descriptor)
    Constructor taking an descriptor
    Parameters:
      `descriptor` - the descriptor iff null, will default to a "text argument" descriptor.

  - ### CLOption

    public CLOption(String argument)
    Constructor taking argument for option.
    Parameters:
      `argument` - the argument

- ## Method Details

  - ### getArgument

    public final String getArgument()
    Retrieve argument to option if it takes arguments.
    Returns:
      the (first) argument

  - ### getArgument

    public final String getArgument(int index)
    Retrieve indexed argument to option if it takes arguments.
    Parameters:
      `index` - The argument index, from 0 to `getArgumentCount()`-1.
    Returns:
      the argument

  - ### getDescriptor

    public final CLOptionDescriptor getDescriptor()

  - ### addArgument

    public final void addArgument(String argument)
    Mutator of Argument property.
    Parameters:
      `argument` - the argument

  - ### getArgumentCount

    public final int getArgumentCount()
    Get number of arguments.
    Returns:
      the number of arguments

  - ### toString

    public final String toString()
    Convert to String.
    Overrides:
      `toString` in class `Object`
    Returns:
      the string value