Package net.dv8tion.jda.api.hooks
Class InterfacedEventManager
java.lang.Object
net.dv8tion.jda.api.hooks.InterfacedEventManager
- All Implemented Interfaces:
IEventManager
An
IEventManager implementation
that uses the EventListener interface for
event listeners.
This only accepts listeners that implement EventListener
An adapter implementation is ListenerAdapter which
provides methods for each individual Event.
This is the default IEventManager used by JDA
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe currently registered listenersvoidhandle(GenericEvent event) Handles the providedGenericEvent.voidRegisters the specified listener
Accepted types may be specified by implementationsvoidunregister(Object listener) Removes the specified listener
-
Constructor Details
-
InterfacedEventManager
public InterfacedEventManager()
-
-
Method Details
-
register
Registers the specified listener
Accepted types may be specified by implementations- Specified by:
registerin interfaceIEventManager- Parameters:
listener- A listener object- Throws:
IllegalArgumentException- If the provided listener does not implementEventListener
-
unregister
Description copied from interface:IEventManagerRemoves the specified listener- Specified by:
unregisterin interfaceIEventManager- Parameters:
listener- The listener object to remove
-
getRegisteredListeners
Description copied from interface:IEventManagerThe currently registered listeners- Specified by:
getRegisteredListenersin interfaceIEventManager- Returns:
- A list of listeners that have already been registered
-
handle
Description copied from interface:IEventManagerHandles the providedGenericEvent.
How this is handled is specified by the implementation.An implementation should not throw exceptions.
- Specified by:
handlein interfaceIEventManager- Parameters:
event- The event to handle
-