Package revxrsal.commands.process
Interface ResponseHandler<T>
- Type Parameters:
T
- The response type
- All Known Implementing Classes:
ComponentResponseHandler
public interface ResponseHandler<T>
A handler for post-handling command responses (results returned from the
command methods)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleResponse
(T response, @NotNull CommandActor actor, @NotNull ExecutableCommand command) Handles the response returned from the methodstatic void
reply
(Object response, @NotNull CommandActor actor, @NotNull ExecutableCommand command) A utility method that directly replies with the response.
-
Method Details
-
handleResponse
void handleResponse(T response, @NotNull @NotNull CommandActor actor, @NotNull @NotNull ExecutableCommand command) Handles the response returned from the method- Parameters:
response
- The response returned from the method. May or may not be null.actor
- The actor of the commandcommand
- The command being executed
-
reply
static void reply(Object response, @NotNull @NotNull CommandActor actor, @NotNull @NotNull ExecutableCommand command) A utility method that directly replies with the response.This is intended to be used as a method reference:
ResponseHandler::reply
- Parameters:
response
- Response to handleactor
- The command actorcommand
- The command being executed
-