- Type Parameters:
T- - event type to handle
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A handler of an event.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic enum -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> EventHandler.Builder<T>builder()handle(T event, EventContext context) Handles the specified event.static <T> EventHandler<T>of(BiConsumer<T, EventContext> handler) static <T> EventHandler<T>static <T> EventHandler<T>withResult(BiConsumer<T, EventContext> handler, EventHandler.Result result) static <T> EventHandler<T>withResult(Consumer<T> handler, EventHandler.Result result)
-
Method Details
-
handle
Handles the specified event.- Parameters:
event- - event to handlecontext- - event context- Returns:
- the result
-
builder
-
of
-
withResult
-
of
-
withResult
static <T> EventHandler<T> withResult(BiConsumer<T, EventContext> handler, EventHandler.Result result)
-