|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjoptsimple.OptionSet
public class OptionSet
Representation of a group of detected command line options, their arguments, and non-option arguments.
Method Summary | ||
---|---|---|
boolean |
equals(java.lang.Object that)
|
|
boolean |
has(OptionSpec<?> option)
Tells whether the given option was detected. |
|
boolean |
has(java.lang.String option)
Tells whether the given option was detected. |
|
boolean |
hasArgument(OptionSpec<?> option)
Tells whether there are any arguments associated with the given option. |
|
boolean |
hasArgument(java.lang.String option)
Tells whether there are any arguments associated with the given option. |
|
int |
hashCode()
|
|
java.util.List<java.lang.String> |
nonOptionArguments()
|
|
|
valueOf(OptionSpec<V> option)
Gives the argument associated with the given option. |
|
java.lang.Object |
valueOf(java.lang.String option)
Gives the argument associated with the given option. |
|
|
valuesOf(OptionSpec<V> option)
Gives any arguments associated with the given option. |
|
java.util.List<?> |
valuesOf(java.lang.String option)
Gives any arguments associated with the given option. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean has(java.lang.String option)
Tells whether the given option was detected.
option
- the option to search for
true
if the option was detectedhas(OptionSpec)
public boolean has(OptionSpec<?> option)
Tells whether the given option was detected.
This method recognizes only instances of options returned from the fluent interface methods.
option
- the option to search for
true
if the option was detectedhas(String)
public boolean hasArgument(java.lang.String option)
Tells whether there are any arguments associated with the given option.
option
- the option to search for
true
if the option was detected and at least one argument was
detected for the optionpublic boolean hasArgument(OptionSpec<?> option)
Tells whether there are any arguments associated with the given option.
This method recognizes only instances of options returned from the fluent interface methods.
option
- the option to search for
true
if the option was detected and at least one argument was
detected for the optionpublic java.lang.Object valueOf(java.lang.String option)
Gives the argument associated with the given option. If the option was given
an argument type, the argument will take on that type; otherwise, it will be a
String
.
option
- the option to search for
null
if no argument is
present, or that option was not detected
OptionException
- if more than one argument was detected for the optionpublic <V> V valueOf(OptionSpec<V> option)
Gives the argument associated with the given option.
This method recognizes only instances of options returned from the fluent interface methods.
V
- represents the type of the arguments the given option acceptsoption
- the option to search for
null
if no argument is
present, or that option was not detected
OptionException
- if more than one argument was detected for the option
java.lang.ClassCastException
- if the arguments of this option are not of the
expected typepublic java.util.List<?> valuesOf(java.lang.String option)
Gives any arguments associated with the given option. If the option was given
an argument type, the arguments will take on that type; otherwise, they will be
String
s.
option
- the option to search for
public <V> java.util.List<V> valuesOf(OptionSpec<V> option)
Gives any arguments associated with the given option. If the option was given
an argument type, the arguments will take on that type; otherwise, they will be
String
s.
This method recognizes only instances of options returned from the fluent interface methods.
V
- represents the type of the arguments the given option acceptsoption
- the option to search for
OptionException
- if there is a problem converting the option's arguments to
the desired type; for example, if the type does not implement a correct conversion
constructor or methodpublic java.util.List<java.lang.String> nonOptionArguments()
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |