|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpellet.PelletCmdOption
public class PelletCmdOption
Title: PelletCmdOption
Description: Represents a pellet command line option, i.e. the option name, the long option name and the option value given on command line
Copyright: Copyright (c) 2008
Company: Clark & Parsia, LLC.
Constructor Summary | |
---|---|
PelletCmdOption(java.lang.String longOption)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
boolean |
exists()
Returns if the option exists in the command-line arguments. |
PelletCmdOptionArg |
getArg()
|
java.lang.Object |
getDefaultValue()
|
java.lang.String |
getDescription()
|
java.lang.String |
getLongOption()
|
java.lang.String |
getShortOption()
|
java.lang.String |
getType()
|
java.lang.Object |
getValue()
|
boolean |
getValueAsBoolean()
Returns the string value as a boolean. |
int |
getValueAsInteger()
Returns the option value as an integer |
int |
getValueAsInteger(int minAllowed,
int maxAllowed)
Returns the option value as an integer and verifies that it is in the given range. |
int |
getValueAsNonNegativeInteger()
Returns the option value as an integer and verifies that the value is a non-negative integer (>= 0). |
int |
getValueAsPositiveInteger()
Returns the option value as an integer and verifies that the value is a positive integer (>= 1). |
java.lang.String |
getValueAsString()
|
int |
hashCode()
|
boolean |
isMandatory()
|
void |
setArg(PelletCmdOptionArg arg)
|
void |
setDefaultValue(java.lang.Object defaultValue)
|
void |
setDescription(java.lang.String description)
|
void |
setExists(boolean exists)
|
void |
setIsMandatory(boolean isMandatory)
|
void |
setShortOption(java.lang.String shortOption)
|
void |
setType(java.lang.String type)
|
void |
setValue(java.lang.Boolean value)
|
void |
setValue(java.lang.String value)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PelletCmdOption(java.lang.String longOption)
Method Detail |
---|
public java.lang.String getShortOption()
public java.lang.String getLongOption()
public void setShortOption(java.lang.String shortOption)
public java.lang.String getType()
public void setType(java.lang.String type)
public void setDescription(java.lang.String description)
public java.lang.String getDescription()
public void setDefaultValue(java.lang.Object defaultValue)
public java.lang.Object getDefaultValue()
public java.lang.Object getValue()
public java.lang.String getValueAsString()
public int getValueAsPositiveInteger() throws PelletCmdException
PelletCmdException
- If the option value does not exist or is a not a valid
positive integer value (>= 1)public int getValueAsNonNegativeInteger() throws PelletCmdException
PelletCmdException
- If the option value does not exist or is a not a valid
non-negative integer value (>= 0)public int getValueAsInteger() throws PelletCmdException
PelletCmdException
- If the option value does not exist or is a not a valid
integer valuepublic int getValueAsInteger(int minAllowed, int maxAllowed) throws PelletCmdException
minAllowed
- Minimum allowed value for the integer (inclusive)maxAllowed
- Maximum allowed value for the integer (inclusive)
PelletCmdException
- If the option value does not exist, is a not a valid integer
value, or not in the specified rangepublic boolean getValueAsBoolean()
false
by
default.
public void setValue(java.lang.String value)
public void setValue(java.lang.Boolean value)
public void setIsMandatory(boolean isMandatory)
public boolean isMandatory()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void setArg(PelletCmdOptionArg arg)
public PelletCmdOptionArg getArg()
public boolean exists()
getValue()
will return a non-null value. If the
argument for this option is optional then getValue()
may still return null.
public void setExists(boolean exists)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |