Class SubscriberImpl<E>

java.lang.Object
org.geysermc.event.subscribe.impl.SubscriberImpl<E>
All Implemented Interfaces:
Subscriber<E>
Direct Known Subclasses:
OwnedSubscriberImpl

public abstract class SubscriberImpl<E> extends Object implements Subscriber<E>
  • Field Details

    • eventClass

      protected final Class<E> eventClass
    • postOrder

      protected final PostOrder postOrder
    • ignoreCancelled

      protected final boolean ignoreCancelled
    • handler

      protected final Consumer<E> handler
  • Constructor Details

    • SubscriberImpl

      public SubscriberImpl(@NonNull Class<E> eventClass, @NonNull Consumer<E> handler, @NonNull PostOrder postOrder)
    • SubscriberImpl

      public SubscriberImpl(Class<E> eventClass, PostOrder postOrder, boolean ignoreCancelled, H handlerInstance, BiConsumer<H,E> handler)
  • Method Details

    • eventClass

      public @NonNull Class<E> eventClass()
      Description copied from interface: Subscriber
      Returns the event class.
      Specified by:
      eventClass in interface Subscriber<E>
    • order

      public @NonNull PostOrder order()
      Description copied from interface: Subscriber
      Returns the post order of this event subscription.
      Specified by:
      order in interface Subscriber<E>
    • ignoreCancelled

      public boolean ignoreCancelled()
      Description copied from interface: Subscriber
      Returns if this subscription ignores cancelled events.
      Specified by:
      ignoreCancelled in interface Subscriber<E>
    • invoke

      public void invoke(@NonNull E event) throws Throwable
      Description copied from interface: Subscriber
      Invokes a given event.
      Specified by:
      invoke in interface Subscriber<E>
      Parameters:
      event - the event to invoke
      Throws:
      Throwable