Package-level declarations

Types

Link copied to clipboard
interface Event

A marker interface that indicates that a class is an event.

Link copied to clipboard
interface EventFilter<E : Event, H>

A filter for a specific type of event.

Link copied to clipboard
interface EventListener<T : Event>

A listener (handler) for an event type.

Link copied to clipboard
interface EventNode<T : Event>

A single node in an event tree.

Link copied to clipboard

The root node of the server's event node tree.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Listener

Used to indicate that the target function is a listener for an event.

Functions

Link copied to clipboard

Creates a new event listener builder for events of the given event type T.

Link copied to clipboard
inline fun <E : Event, H> EventFilter.Companion.create(handlerGetter: Function<E, H>?): EventFilter<E, H>

Creates a new event filter for the given event type E and handler type H on the event, using the given handlerGetter, if given, to get the handler object from the event.

Link copied to clipboard
inline fun <T : Event> EventListener.Companion.of(crossinline handler: (T) -> Unit): EventListener<T>

Creates a new event listener that listens for events of the given event type T, running the given handler when an event of the correct type is fired.

Link copied to clipboard
inline fun <T : Event, E : T> EventNode<T>.registerListener(handler: Consumer<E>)

Registers an event listener for the given event type T to this event node, calling the given handler when the event is fired.