typed
Returns a TypedEventBus view over this bus restricted to subtypes of E.
The returned bus shares the underlying handler registry; handlers registered on either the typed view or the original bus are visible to both.
Java callers pass a class token for type inference:
TypedEventBus<NetworkEvent> bus =
TypedEventBusFactory.typed(underlying, NetworkEvent.class);Content copied to clipboard
Parameters
root Class
Unused at runtime (erased); present only to satisfy Java's type inference.
Returns a TypedEventBus view over this bus restricted to subtypes of E.
The returned bus shares the underlying handler registry; handlers registered on either the typed view or the original bus are visible to both.
val networkBus = EventBus().typed<NetworkEvent>()
networkBus.post(PacketReceived(bytes))Content copied to clipboard