Package org.geysermc.event.bus
Interface BaseBus<E,S extends Subscriber<? extends E>>
-
- All Known Subinterfaces:
EventBus<E,S>,OwnedEventBus<O,E,S>
- All Known Implementing Classes:
EventBusImpl,OwnedEventBusImpl
public interface BaseBus<E,S extends Subscriber<? extends E>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FireResultfire(@NonNull E event)Fires the given event and log all exceptions that occur while executing this event.FireResultfireSilently(@NonNull E event)Fires the given event silently.<T extends E>
@NonNull java.util.Set<? extends Subscriber<T>>subscribers(@NonNull java.lang.Class<T> eventClass)Gets the subscriptions for the given event class.voidunsubscribe(@NonNull S subscription)Unsubscribes the givenSubscriber.
-
-
-
Method Detail
-
unsubscribe
void unsubscribe(@NonNull S subscription)
Unsubscribes the givenSubscriber.- Parameters:
subscription- the event subscription
-
fire
FireResult fire(@NonNull E event)
Fires the given event and log all exceptions that occur while executing this event.- Parameters:
event- the event to fire
-
fireSilently
FireResult fireSilently(@NonNull E event)
Fires the given event silently.- Parameters:
event- the event to fire- Returns:
- the result of firing the given event
-
subscribers
<T extends E> @NonNull java.util.Set<? extends Subscriber<T>> subscribers(@NonNull java.lang.Class<T> eventClass)
Gets the subscriptions for the given event class.- Type Parameters:
T- the value- Parameters:
eventClass- the event class- Returns:
- the subscriptions for the event class
-
-