# Uses of Class
org.apache.commons.cli.Option

- ## Uses of Option in org.apache.commons.cli

  Fields in org.apache.commons.cli declared as Option
  Modifier and Type
  Field
  Description
  `protected Option`
  DefaultParser.`currentOption`
  The last option parsed.
  Fields in org.apache.commons.cli with type parameters of type Option
  Modifier and Type
  Field
  Description
  `protected Comparator<Option>`
  HelpFormatter.`optionComparator`
  Comparator used to sort the options when they output in help text Defaults to case-insensitive alphabetical sorting by option key
  Methods in org.apache.commons.cli that return Option
  Modifier and Type
  Method
  Description
  `Option`
  Option.Builder.`build()`
  Constructs an Option with the values declared by this `Option.Builder`.
  `static Option`
  OptionBuilder.`create()`
  Deprecated.
  Creates an Option using the current settings
  `static Option`
  OptionBuilder.`create(char opt)`
  Deprecated.
  Creates an Option using the current settings and with the specified Option `char`.
  `static Option`
  OptionBuilder.`create(String opt)`
  Deprecated.
  Creates an Option using the current settings and with the specified Option `char`.
  `Option`
  AlreadySelectedException.`getOption()`
  Gets the option that was added to the group and triggered the exception.
  `Option`
  MissingArgumentException.`getOption()`
  Gets the option requiring an argument that wasn't provided on the command line.
  `Option`
  Options.`getOption(String opt)`
  Gets the `Option` matching the long or short name specified.
  `Option[]`
  CommandLine.`getOptions()`
  Gets an array of the processed `Option`s.
  Methods in org.apache.commons.cli that return types with arguments of type Option
  Modifier and Type
  Method
  Description
  `Comparator<Option>`
  HelpFormatter.`getOptionComparator()`
  Comparator used to sort the options when they output in help text.
  `Collection<Option>`
  OptionGroup.`getOptions()`
  `Collection<Option>`
  Options.`getOptions()`
  Gets a read-only list of options in this set
  `Iterator<Option>`
  CommandLine.`iterator()`
  Returns an iterator over the Option members of CommandLine.
  Methods in org.apache.commons.cli with parameters of type Option
  Modifier and Type
  Method
  Description
  `protected void`
  CommandLine.`addOption(Option opt)`
  Adds an option to the command line.
  `CommandLine.Builder`
  CommandLine.Builder.`addOption(Option opt)`
  Adds an option to the command line.
  `OptionGroup`
  OptionGroup.`addOption(Option option)`
  Add the specified `Option` to this group.
  `Options`
  Options.`addOption(Option opt)`
  Adds an option instance
  `OptionGroup`
  Options.`getOptionGroup(Option opt)`
  Gets the OptionGroup the `opt` belongs to.
  `Properties`
  CommandLine.`getOptionProperties(Option option)`
  Gets the map of values associated to the option.
  `String`
  CommandLine.`getOptionValue(Option option)`
  Gets the first argument, if any, of this option.
  `String`
  CommandLine.`getOptionValue(Option option, String defaultValue)`
  Gets the first argument, if any, of an option.
  `String`
  CommandLine.`getOptionValue(Option option, Supplier<String> defaultValue)`
  Gets the first argument, if any, of an option.
  `String[]`
  CommandLine.`getOptionValues(Option option)`
  Gets the array of values, if any, of an option.
  `<T> T`
  CommandLine.`getParsedOptionValue(Option option)`
  Gets a version of this `Option` converted to a particular type.
  `<T> T`
  CommandLine.`getParsedOptionValue(Option option, Supplier<T> defaultValue)`
  Gets a version of this `Option` converted to a particular type.
  `<T> T`
  CommandLine.`getParsedOptionValue(Option option, T defaultValue)`
  Gets a version of this `Option` converted to a particular type.
  `boolean`
  CommandLine.`hasOption(Option opt)`
  Tests to see if an option has been set.
  `void`
  Parser.`processArgs(Option opt, ListIterator<String> iter)`
  Deprecated.
  Process the argument values for the specified Option `opt` using the values retrieved from the specified iterator `iter`.
  `void`
  OptionGroup.`setSelected(Option option)`
  Sets the selected option of this group to `name`.
  Method parameters in org.apache.commons.cli with type arguments of type Option
  Modifier and Type
  Method
  Description
  `CommandLine.Builder`
  CommandLine.Builder.`setDeprecatedHandler(Consumer<Option> deprecatedHandler)`
  Sets the deprecated option handler.
  `DefaultParser.Builder`
  DefaultParser.Builder.`setDeprecatedHandler(Consumer<Option> deprecatedHandler)`
  Sets the deprecated option handler.
  `void`
  HelpFormatter.`setOptionComparator(Comparator<Option> comparator)`
  Sets the comparator used to sort the options when they output in help text.
  Constructors in org.apache.commons.cli with parameters of type Option
  Modifier
  Constructor
  Description
  ``
  `AlreadySelectedException(OptionGroup group, Option option)`
  Constructs a new `AlreadySelectedException` for the specified option group.
  ``
  `MissingArgumentException(Option option)`
  Constructs a new `MissingArgumentException` with the specified detail message.