public class SimpleParameter extends java.lang.Object implements Parameter
Parameter
that has setters.Constructor and Description |
---|
SimpleParameter()
Create a new parameter with no name defined yet.
|
SimpleParameter(java.lang.String name)
Create a new parameter of the given name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getDefaultValue()
Get the default value as a string to be parsed by the binding.
|
java.lang.Character |
getFlag()
Get the flag associated with this parameter.
|
java.lang.String |
getName()
The name of the parameter.
|
boolean |
isOptional()
Get whether this parameter is optional.
|
boolean |
isValueFlag()
Return whether the flag is a value flag.
|
void |
setDefaultValue(java.lang.String[] defaultValue)
Set the default value.
|
void |
setFlag(java.lang.Character flag,
boolean isValue)
Set the flag used by this parameter.
|
void |
setName(java.lang.String name)
Set the name of the parameter.
|
void |
setOptional(boolean isOptional)
Set whether this parameter is optional.
|
java.lang.String |
toString() |
public SimpleParameter()
public SimpleParameter(java.lang.String name)
name
- the namepublic java.lang.String getName()
Parameter
public void setName(java.lang.String name)
name
- the parameter namepublic java.lang.Character getFlag()
Parameter
getFlag
in interface Parameter
Parameter.isValueFlag()
public boolean isValueFlag()
Parameter
isValueFlag
in interface Parameter
Parameter.getFlag()
public void setFlag(java.lang.Character flag, boolean isValue)
flag
- the flag, or null if there is no flagisValue
- true if the flag is a value flagpublic boolean isOptional()
Parameter
isOptional
in interface Parameter
public void setOptional(boolean isOptional)
isOptional
- true if this parameter is optionalpublic java.lang.String[] getDefaultValue()
Parameter
getDefaultValue
in interface Parameter
public void setDefaultValue(java.lang.String[] defaultValue)
defaultValue
- a default value, or null if nonepublic java.lang.String toString()
toString
in class java.lang.Object