public abstract class CommandParameter
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
description
The description string for this parameter, e.g.
|
private java.lang.String |
identifier
The identifier string for the command parameter
|
Constructor and Description |
---|
CommandParameter(java.lang.String id,
java.lang.String des)
non-empty constructor (member variables cannot be changed after construction)
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription()
returns the description for this parameter
|
java.lang.String |
getIdentifier()
returns this parameters name (the identifier)
|
abstract CommandParameter |
instantiate(java.lang.String s)
instantiate the command with the given argument string if valid
|
abstract boolean |
isValid(java.lang.String s)
Checks, if the given String is a valid argument for this command parameter
|
private java.lang.String identifier
private java.lang.String description
public CommandParameter(java.lang.String id, java.lang.String des)
id
- the identifier string for this command parameter (e.g. aggr for aggregation)des
- the description string for this command parameterpublic java.lang.String getIdentifier()
public java.lang.String getDescription()
public abstract boolean isValid(java.lang.String s)
s
- the given input stringpublic abstract CommandParameter instantiate(java.lang.String s)
s
- the given argument string