ParamType - The command parameter typeResultType - The command result typepublic interface RunnableCommandTask<ParamType,ResultType> extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
default void |
close()
Called when the command id becomes invalid
|
default void |
onFinish(ObservableCommandWrapper<ParamType,ResultType> command,
boolean withError) |
default void |
onNewCommand(ObservableCommandWrapper<ParamType,ResultType> newCommand)
Called when a new command is added in the command manager
|
default void |
preRun(ParamType parameters,
UUID commandExecutionUUID) |
ResultType |
run(ObservableCommandWrapper<ParamType,ResultType> command)
Run the command task
|
default void |
validate(ParamType parameters) |
ResultType run(ObservableCommandWrapper<ParamType,ResultType> command) throws StatusRuntimeException
command - The command object linked to this taskStatusRuntimeException - If an error occur during the taskdefault void validate(ParamType parameters) throws StatusRuntimeException
StatusRuntimeExceptiondefault void onFinish(ObservableCommandWrapper<ParamType,ResultType> command, boolean withError)
default void close()
close in interface AutoCloseabledefault void onNewCommand(ObservableCommandWrapper<ParamType,ResultType> newCommand)
newCommand - The new command addedCopyright © 2022 SiLA Java Developers. All rights reserved.