Package net.dv8tion.jda.api.hooks
Class InterfacedEventManager
- java.lang.Object
-
- net.dv8tion.jda.api.hooks.InterfacedEventManager
-
- All Implemented Interfaces:
IEventManager
public class InterfacedEventManager extends Object implements IEventManager
AnIEventManagerimplementation that uses theEventListenerinterface for event listeners.This only accepts listeners that implement
EventListener
An adapter implementation isListenerAdapterwhich provides methods for each individualEvent.This is the default IEventManager used by JDA
- See Also:
AnnotatedEventManager,IEventManager
-
-
Constructor Summary
Constructors Constructor Description InterfacedEventManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Object>getRegisteredListeners()The currently registered listenersvoidhandle(GenericEvent event)Handles the providedGenericEvent.voidregister(Object listener)Registers the specified listener
Accepted types may be specified by implementationsvoidunregister(Object listener)Removes the specified listener
-
-
-
Method Detail
-
register
public void register(@Nonnull Object listener)
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
public void unregister(@Nonnull Object listener)
Description copied from interface:IEventManagerRemoves the specified listener- Specified by:
unregisterin interfaceIEventManager- Parameters:
listener- The listener object to remove
-
getRegisteredListeners
@Nonnull public List<Object> getRegisteredListeners()
Description copied from interface:IEventManagerThe currently registered listeners- Specified by:
getRegisteredListenersin interfaceIEventManager- Returns:
- An immutable list of listeners that have already been registered
-
handle
public void handle(@Nonnull GenericEvent event)
Description copied from interface:IEventManagerHandles the providedGenericEvent. How this is handled is specified by the implementation.- Specified by:
handlein interfaceIEventManager- Parameters:
event- The event to handle
-
-