public class OptionData extends java.lang.Object implements Constrainable
Options.check() methods, but not access to any of the other methods
which are used internally for the operation of the actual check.| Modifier and Type | Class and Description |
|---|---|
static class |
OptionData.Type
An enum describing the different available types of options
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConstraint(Constraint constraint)
Add a constraint for this option
|
java.util.List<Constraint> |
getConstraints()
Get the constraints defined for this option
|
java.lang.String |
getDetailText()
Return the text to be used for the <detail> argument of a detail option
|
java.lang.String |
getHelpText()
Return the text describing the purpose of the option
|
int |
getResultCount()
Get the number of results found for this option, which is number of times the key matched
|
java.lang.String |
getResultDetail(int index)
Get the detail with the given index.
|
java.util.List<java.lang.String> |
getResultDetails()
Return a list of all option details
|
java.lang.String |
getResultValue(int index)
Get the value with the given index.
|
java.util.List<java.lang.String> |
getResultValues()
Return a list of all result values
|
java.lang.String |
getSyntax()
Get the command line syntax for this option.
|
java.lang.String |
getValueText()
Return the text to be used for the <value> argument of a value option
|
boolean |
isSet()
Check whether this option has been found on the command line
|
OptionData |
setDetailText(java.lang.String text)
Set the text to be used for the <detail> argument of a value option.
|
OptionData |
setHelpText(java.lang.String text)
Set the text describing the purpose of the option.
|
OptionData |
setValueText(java.lang.String text)
Set the text to be used for the <value> argument of a value option.
|
java.lang.String |
toString()
This is the overloaded
Object.toString() method. |
public boolean isSet()
public int getResultCount()
public java.lang.String getResultValue(int index)
getResultCount() - 1.
However, only for value options, a non-null value will be returned. Non-value options always
return null.
index - The index for the desired value
public java.util.List<java.lang.String> getResultValues()
public java.lang.String getResultDetail(int index)
getResultCount() - 1.
However, only for value options which take details, a non-null detail will be returned. Non-value options
and value options which do not take details always return null.
index - The index for the desired value
public java.util.List<java.lang.String> getResultDetails()
public OptionData setValueText(java.lang.String text)
HelpPrinter output.
text - The text used for the <value> argument of a value option
public OptionData setDetailText(java.lang.String text)
HelpPrinter output.
text - The text used for the <detail> argument of a value option
public OptionData setHelpText(java.lang.String text)
HelpPrinter output.
text - The text describing the purpose of the option
public java.lang.String getHelpText()
public java.lang.String getValueText()
public java.lang.String getDetailText()
public void addConstraint(Constraint constraint)
addConstraint in interface Constrainableconstraint - The Constraint to addpublic java.util.List<Constraint> getConstraints()
getConstraints in interface Constrainablenull if no constraints have been defined)public java.lang.String getSyntax()
public java.lang.String toString()
Object.toString() method.
toString in class java.lang.Object