public class IntegerCommandParameter extends CommandParameter
Modifier and Type | Field and Description |
---|---|
private Interval<java.lang.Integer> |
interval
all possible values for this parameter's argument
|
private java.lang.Integer |
value
the value each instantiated needs, has to be in selections
|
Constructor and Description |
---|
IntegerCommandParameter(java.lang.String id,
java.lang.String des) |
IntegerCommandParameter(java.lang.String id,
java.lang.String des,
Interval<java.lang.Integer> interval) |
IntegerCommandParameter(java.lang.String id,
java.lang.String des,
java.lang.String interval) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
Interval<java.lang.Integer> |
getInterval()
returns each possible selection argument
|
java.lang.Integer |
getValue()
returns the given instantiation argument value for this parameter
|
CommandParameter |
instantiate(java.lang.String s)
instantiates a new parameter iff the given value is 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 |
setInterval(java.lang.String interval)
sets new selection parameter
|
void |
setValue(java.lang.Integer value)
sets the instantiated parameter argument value,
value has to be one of the options contained in selections
|
getDescription, getIdentifier
private Interval<java.lang.Integer> interval
private java.lang.Integer value
public IntegerCommandParameter(java.lang.String id, java.lang.String des)
public IntegerCommandParameter(java.lang.String id, java.lang.String des, Interval<java.lang.Integer> interval)
public IntegerCommandParameter(java.lang.String id, java.lang.String des, java.lang.String interval)
public void setInterval(java.lang.String interval)
interval
- public Interval<java.lang.Integer> getInterval()
public java.lang.Integer getValue()
public void setValue(java.lang.Integer value)
value
- the value given as argument valuepublic boolean isValid(java.lang.String s)
isValid
in class CommandParameter
s
- the given input stringpublic CommandParameter instantiate(java.lang.String s)
instantiate
in class CommandParameter
s
- the given argument stringpublic java.lang.Object clone()
clone
in class java.lang.Object
java.lang.CloneNotSupportedException