public class Command extends Object
| Constructor and Description |
|---|
Command(String command)
Constructor
|
Command(String command,
Properties params)
Constructor
|
Command(String command,
String params)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkParam(String p)
Checks if the parameter exists
|
String |
getCommand()
Command getter
|
String |
getParam(String p)
Returns the parameter value
|
Properties |
getParameters()
Paremeters getter
|
String |
getParamMandatory(String p)
Returns the command's mandatory parameter value
|
boolean |
match(String cms)
Returns true if the command matches the command name
|
void |
paramsProcessed()
Checks if there are no extra parameters present
Should be called once all valid parameters are processed
|
void |
setCommand(String command)
Command setter
|
void |
setParameters(Properties parameters)
Parameters setter
|
String |
toString() |
public Command(String command)
command - command namepublic Command(String command, Properties params)
command - command nameparams - parameterspublic String getCommand()
public void setCommand(String command)
command - commandpublic Properties getParameters()
public void setParameters(Properties parameters)
parameters - command parameterspublic boolean match(String cms)
cms - command namepublic String getParamMandatory(String p) throws InvalidParameterException
p - parameter nameInvalidParameterException - if the parameter doesn't existpublic String getParam(String p)
p - parameter namepublic boolean checkParam(String p)
p - parameter namepublic void paramsProcessed()
InvalidParameterException - if there are unprocessed parametersCopyright © 2014. All rights reserved.