|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mockftpserver.core.command.Command
public final class Command
Represents a command received from an FTP client, containing a command name and parameters. Objects of this class are immutable.
| Constructor Summary | |
|---|---|
Command(String name,
List parameters)
Construct a new immutable instance with the specified command name and parameters |
|
Command(String name,
String[] parameters)
Construct a new immutable instance with the specified command name and parameters |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
String |
getName()
|
String |
getOptionalString(int index)
Get the String value of the parameter at the specified index; return null if no parameter exists for the index. |
String |
getParameter(int index)
Get the String value of the parameter at the specified index; return null if no parameter exists for the index |
String[] |
getParameters()
|
String |
getRequiredParameter(int index)
Get the String value of the parameter at the specified index |
int |
hashCode()
|
static String |
normalizeName(String name)
Return the name, normalized to a common format - convert to upper case. |
String |
toString()
Return the String representation of this object |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Command(String name,
String[] parameters)
name - - the command name; may not be nullparameters - - the command parameters; may be empty; may not be null
public Command(String name,
List parameters)
name - - the command name; may not be nullparameters - - the command parameters; may be empty; may not be null| Method Detail |
|---|
public String getName()
public String[] getParameters()
public String getRequiredParameter(int index)
index - - the index
AssertFailedException - if the parameter index is invalid or the value is not a valid Stringpublic String getParameter(int index)
index - - the index
public String getOptionalString(int index)
getParameter(int).
index - - the index
public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public String toString()
toString in class ObjectObject.toString()public static String normalizeName(String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||