Class DispatchHandlers

java.lang.Object
discord4j.core.event.dispatch.DispatchHandlers
All Implemented Interfaces:
DispatchEventMapper

public class DispatchHandlers extends Object implements DispatchEventMapper
Registry for Dispatch to Event mapping operations.
  • Constructor Details

    • DispatchHandlers

      public DispatchHandlers()
  • Method Details

    • handle

      public <D, S, E extends Event> Mono<E> handle(DispatchContext<D,S> context)
      Process a Dispatch object wrapped with its context to potentially obtain an Event.
      Specified by:
      handle in interface DispatchEventMapper
      Type Parameters:
      D - the Dispatch type
      S - the old state type, if applicable
      E - the resulting Event type
      Parameters:
      context - the DispatchContext used with this Dispatch object
      Returns:
      an Event mapped from the given Dispatch object, or null if no Event is produced.