Class EventWaiter

  • All Implemented Interfaces:
    net.dv8tion.jda.api.hooks.EventListener

    public class EventWaiter
    extends java.lang.Object
    implements net.dv8tion.jda.api.hooks.EventListener
    Took from JDA utilities in order to fix some concurrency issues
    • Constructor Summary

      Constructors 
      Constructor Description
      EventWaiter​(java.util.concurrent.ScheduledExecutorService threadpool)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onEvent​(net.dv8tion.jda.api.events.GenericEvent event)  
      <T extends net.dv8tion.jda.api.events.Event>
      void
      waitForEvent​(java.lang.Class<T> classType, java.util.function.Predicate<T> condition, java.util.function.Consumer<T> action, java.lang.Runnable timeoutAction)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventWaiter

        public EventWaiter​(java.util.concurrent.ScheduledExecutorService threadpool)
    • Method Detail

      • waitForEvent

        public <T extends net.dv8tion.jda.api.events.Event> void waitForEvent​(java.lang.Class<T> classType,
                                                                              java.util.function.Predicate<T> condition,
                                                                              java.util.function.Consumer<T> action,
                                                                              java.lang.Runnable timeoutAction)
      • onEvent

        public final void onEvent​(net.dv8tion.jda.api.events.GenericEvent event)
        Specified by:
        onEvent in interface net.dv8tion.jda.api.hooks.EventListener