public class SelectionCommandParameter extends CommandParameter
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String[] |
selections
all possible values for this parameter's argument
|
private java.lang.String |
value
the value each instantiated needs, has to be in selections
|
| Constructor and Description |
|---|
SelectionCommandParameter(java.lang.String id,
java.lang.String des) |
SelectionCommandParameter(java.lang.String id,
java.lang.String des,
java.lang.String[] selections) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
java.lang.String[] |
getSelections()
returns each possible selection argument
|
java.lang.String |
getValue()
returns the given instantiation argument value for this parameter
|
java.util.ArrayList<CommandParameter> |
instantiate(java.util.ArrayList<java.lang.String> s) |
CommandParameter |
instantiate(java.lang.String s)
instantiates a new parameter iff the given value ist valid for this
command parameter
|
boolean |
isValid(java.lang.String s)
checks whether a cli input parameter argument is valid for the called
command parameter
|
void |
setSelections(java.lang.String[] selections)
sets new selection parameter
|
void |
setValue(java.lang.String value)
sets the instantiated parameter argument value, value has to be one of
the options contained in selections
|
getDescription, getIdentifierprivate java.lang.String[] selections
private java.lang.String value
public SelectionCommandParameter(java.lang.String id,
java.lang.String des)
id - des - public SelectionCommandParameter(java.lang.String id,
java.lang.String des,
java.lang.String[] selections)
id - des - selections - public java.lang.String[] getSelections()
public void setSelections(java.lang.String[] selections)
selections - public java.lang.String getValue()
public void setValue(java.lang.String value)
value - the value given as argument valuepublic boolean isValid(java.lang.String s)
isValid in class CommandParameters - the given input stringpublic CommandParameter instantiate(java.lang.String s)
instantiate in class CommandParameters - the given argument stringpublic java.util.ArrayList<CommandParameter> instantiate(java.util.ArrayList<java.lang.String> s)
public java.lang.Object clone()
clone in class java.lang.Object