Package net.kautler.command.api.event
Class CommandEvent<M>
- java.lang.Object
-
- net.kautler.command.api.event.CommandEvent<M>
-
- Type Parameters:
M
- the class of the message in the command context payload
- Direct Known Subclasses:
CommandNotAllowedEventJavacord
,CommandNotAllowedEventJavacordSlash
,CommandNotAllowedEventJda
,CommandNotFoundEventJavacord
,CommandNotFoundEventJavacordSlash
,CommandNotFoundEventJda
public class CommandEvent<M> extends Object
A base event with a command context as payload that is sent asynchronously via the CDI event mechanism. It can be handled using@ObservesAsync
.- See Also:
@ObservesAsync
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CommandEvent(CommandContext<M> commandContext)
Constructs a new command event with the given command context as payload.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandContext<M>
getCommandContext()
Returns the command context payload of this command event.String
toString()
-
-
-
Constructor Detail
-
CommandEvent
protected CommandEvent(CommandContext<M> commandContext)
Constructs a new command event with the given command context as payload.- Parameters:
commandContext
- the command context, usually populated according to current phase
-
-
Method Detail
-
getCommandContext
public CommandContext<M> getCommandContext()
Returns the command context payload of this command event.- Returns:
- the command context payload of this command event
-
-