public class ExecuteCommandCommand extends java.lang.Object implements GUICommand2
GUICommand
which executes a Crossfire command.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
command
The command to execute.
|
private CommandExecutor |
commandExecutor
The
CommandExecutor for executing the command. |
private Macros |
macros
The
Macros instance to use. |
Constructor and Description |
---|
ExecuteCommandCommand(CommandExecutor commandExecutor,
java.lang.String command,
Macros macros)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExecute()
Returns whether this command may be executed.
|
void |
execute()
Executes the command.
|
java.lang.String |
getCommandString()
Returns the command as a string.
|
@NotNull private final java.lang.String command
@NotNull private final CommandExecutor commandExecutor
CommandExecutor
for executing the command.public ExecuteCommandCommand(@NotNull CommandExecutor commandExecutor, @NotNull java.lang.String command, @NotNull Macros macros)
commandExecutor
- the command executor for executing the commandcommand
- the command to executemacros
- the macros instance to usepublic boolean canExecute()
canExecute
in interface GUICommand
public void execute()
GUICommand.canExecute()
returns false
.execute
in interface GUICommand
@NotNull public java.lang.String getCommandString()
getCommandString
in interface GUICommand2