public abstract class AbstractCommand extends java.lang.Object implements Command
Command
implementations.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
commandName
The name of the command.
|
private CrossfireServerConnection |
crossfireServerConnection
The connection instance.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractCommand(java.lang.String commandName,
CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
drawInfo(java.lang.String message)
Displays a regular output message.
|
protected void |
drawInfo(java.lang.String message,
int color)
Displays a message.
|
protected void |
drawInfoError(java.lang.String message)
Displays an error message.
|
java.lang.String |
getCommandName()
Returns the name of the command.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
allArguments, execute
@NotNull private final java.lang.String commandName
@NotNull private final CrossfireServerConnection crossfireServerConnection
protected AbstractCommand(@NotNull java.lang.String commandName, @NotNull CrossfireServerConnection crossfireServerConnection)
commandName
- the name of the commandcrossfireServerConnection
- the connection instanceprotected void drawInfo(@NotNull java.lang.String message)
message
- the messageprotected void drawInfo(@NotNull java.lang.String message, int color)
message
- the messagecolor
- the color codeprotected void drawInfoError(@NotNull java.lang.String message)
message
- the error message@NotNull public java.lang.String getCommandName()
getCommandName
in interface Command
@NotNull public java.lang.String toString()
toString
in class java.lang.Object