Class EventBusRegistry.EventConsumerMap<EventType extends IBaseEvent, ConsumerType extends EventBusRegistry.EventConsumer, ReturnType>

java.lang.Object
com.hypixel.hytale.event.EventBusRegistry.EventConsumerMap<EventType, ConsumerType, ReturnType>
Type Parameters:
EventType - The class type of event.
ConsumerType - The class type of event consumer.
ReturnType - The return type of the event dispatcher.
All Implemented Interfaces:
IEventDispatcher<EventType, ReturnType>
Enclosing class:
EventBusRegistry<KeyType, EventType extends IBaseEvent<KeyType>, ConsumerMapType extends EventBusRegistry.EventConsumerMap<EventType, ?, ?>>

public abstract static class EventBusRegistry.EventConsumerMap<EventType extends IBaseEvent, ConsumerType extends EventBusRegistry.EventConsumer, ReturnType> extends Object implements IEventDispatcher<EventType, ReturnType>
A class that represents a map of event consumers organized by priority.
  • Constructor Details

    • EventConsumerMap

      public EventConsumerMap()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns:
      true if this consumer map is empty, false otherwise.
    • add

      public void add(@Nonnull ConsumerType eventConsumer)
      Called to add the given event consumer to this consumer map.
      Parameters:
      eventConsumer - The event consumer to add.
    • remove

      public boolean remove(@Nonnull ConsumerType consumer)
      Called to remove the given event consumer from this consumer map.
      Parameters:
      consumer - The event consumer to remove.
      Returns:
      true if the consumer was removed, false otherwise.
    • getPriorities

      public short[] getPriorities()
      Returns:
      the array of priorities in this consumer map.
    • get

      @Nullable public List<ConsumerType> get(short priority)
      Called to get a list of event consumers for the given priority.
      Parameters:
      priority - The priority to get consumers for.
      Returns:
      the list of event consumers for the given priority, or null if none exist.