Package net.blueva.arcade.api.events
Class EventSubscription<E>
java.lang.Object
net.blueva.arcade.api.events.EventSubscription<E>
- Type Parameters:
E- Event type handled by the subscription.
Platform-agnostic event registration wrapper.
This is intended for platforms where event registration requires both an event class and a handler reference (e.g. Hytale's EventRegistry).
-
Constructor Summary
ConstructorsConstructorDescriptionEventSubscription(Class<E> eventClass, Consumer<E> handler) Constructs a new event subscription. -
Method Summary
Modifier and TypeMethodDescriptionGets the event class this subscription listens for.Gets the handler that processes the event.
-
Constructor Details
-
EventSubscription
Constructs a new event subscription.- Parameters:
eventClass- the event class to listen forhandler- the consumer that will handle the event- Throws:
NullPointerException- if eventClass or handler is null
-
-
Method Details
-
getEventClass
Gets the event class this subscription listens for.- Returns:
- the event class
-
getHandler
Gets the handler that processes the event.- Returns:
- the event handler consumer
-