Java org.apache.commons.cli Option fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.cli Option fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.cli Option.

The text is from its open source code.

Subclass

org.apache.commons.cli.Option has subclasses.
Click this link to see all its subclasses.

Field

intUNINITIALIZED
constant that specifies the number of argument values has not been specified
intUNLIMITED_VALUES
constant that specifies the number of argument values is infinite
Stringopt
the name of the option
StringlongOpt
the long representation of the option
StringargName
the name of the argument for this option
Stringdescription
description of the option
booleanrequired
specifies whether this option is required to be present
intnumberOfArgs
the number of argument values this option can have
Objecttype
the type of this Option

Constructor

Option(String opt, String longOpt, boolean hasArg, String description)
Creates an Option using the specified parameters.
Option(String opt, boolean hasArg, String description)
Creates an Option using the specified parameters.
Option(String opt, String description)
Creates an Option using the specified parameters.

Method

voidadd(String value)
Add the value to this Option.
booleanaddValue(String value)
This method is not intended to be used.
Objectclone()
A rather odd clone method - due to incorrect code in 1.0 it is public and in 1.1 rather than throwing a CloneNotSupportedException it throws a RuntimeException so as to maintain backwards compat at the API level.
booleanequals(Object o)
StringgetArgName()
Gets the display name for the argument value.
intgetArgs()
Returns the number of argument values this Option can take.
StringgetDescription()
Retrieve the self-documenting description of this Option
intgetId()
Returns the id of this Option.
StringgetLongOpt()
Retrieve the long name of this Option.
StringgetOpt()
Retrieve the name of this Option.
ObjectgetType()
Retrieve the type of this Option.
StringgetValue()
Returns the specified value of this Option or null if there is no value.
StringgetValue(int index)
Returns the specified value of this Option or null if there is no value.
StringgetValue(String defaultValue)
Returns the value/first value of this Option or the defaultValue if there is no value.
String[]getValues()
Return the values of this Option as a String array or null if there are no values
chargetValueSeparator()
Returns the value separator character.
ListgetValuesList()
booleanhasArg()
Query to see if this Option requires an argument
booleanhasArgName()
Returns whether the display name for the argument value has been set.
booleanhasArgs()
Query to see if this Option can take many values.
booleanhasLongOpt()
Query to see if this Option has a long name
booleanhasOptionalArg()
booleanhasValueSeparator()
Return whether this Option has specified a value separator.
booleanisRequired()
Query to see if this Option requires an argument
voidsetArgName(String argName)
Sets the display name for the argument value.
voidsetArgs(int num)
Sets the number of argument values this Option can take.
voidsetDescription(String description)
Sets the self-documenting description of this Option
voidsetLongOpt(String longOpt)
Sets the long name of this Option.
voidsetOptionalArg(boolean optionalArg)
Sets whether this Option can have an optional argument.
voidsetRequired(boolean required)
Sets whether this Option is mandatory.
voidsetType(Object type)
Sets the type of this Option.
voidsetValueSeparator(char sep)
Sets the value separator.
StringtoString()
Dump state, suitable for debugging.