Package com.codingchili.core.context
Class BaseCommand
java.lang.Object
com.codingchili.core.context.BaseCommand
- All Implemented Interfaces:
Command
A basic
-
Constructor Summary
ConstructorDescriptionBaseCommand(BiFunction<io.vertx.core.Promise<CommandResult>,CommandExecutor,Void> consumer, String name, String description)
Creates a new asynchronous command.BaseCommand(Function<CommandExecutor,CommandResult> runnable, String name, String description)
Creates a new synchronous command -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute(io.vertx.core.Promise<CommandResult> future, CommandExecutor executor)
Executes a command.getName()
boolean
Indicates if this command should be printed in the help dialog.setVisible(Boolean visible)
-
Constructor Details
-
BaseCommand
public BaseCommand(BiFunction<io.vertx.core.Promise<CommandResult>,CommandExecutor,Void> consumer, String name, String description)Creates a new asynchronous command.- Parameters:
consumer
- the function to be called when the command is executed.name
- the handler of the commanddescription
- the command description
-
BaseCommand
public BaseCommand(Function<CommandExecutor,CommandResult> runnable, String name, String description)Creates a new synchronous command- Parameters:
runnable
- executed when the command is invokedname
- the handler of the commanddescription
- the command description
-
-
Method Details
-
setVisible
-
isVisible
public boolean isVisible()Description copied from interface:Command
Indicates if this command should be printed in the help dialog. -
execute
Description copied from interface:Command
Executes a command. -
getDescription
- Specified by:
getDescription
in interfaceCommand
- Returns:
- the command description.
-
getName
-