public final class Events extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
call(Event event)
Submit the event on the current thread
|
static <T extends Event> |
callAndReturn(T event)
Submit the event on the current thread
|
static void |
callAsync(Event event)
Submit the event on a new async thread.
|
static <T extends Event> |
callAsyncAndJoin(T event)
Submit the event on a new async thread.
|
static void |
callSync(Event event)
Submit the event on the main server thread.
|
static <T extends Event> |
callSyncAndJoin(T event)
Submit the event on the main server thread.
|
static <S extends Event> |
merge(Class<S> superClass,
Class<? extends S>... eventClasses)
Makes a MergedSubscriptionBuilder for a super event class
|
static <S extends Event> |
merge(Class<S> superClass,
EventPriority priority,
Class<? extends S>... eventClasses)
Makes a MergedSubscriptionBuilder for a super event class
|
static <T> MergedSubscriptionBuilder<T> |
merge(Class<T> handledClass)
Makes a MergedSubscriptionBuilder for a given super type
|
static <T> MergedSubscriptionBuilder<T> |
merge(TypeToken<T> type)
Makes a MergedSubscriptionBuilder for a given super type
|
static <T extends Event> |
subscribe(Class<T> eventClass)
Makes a SingleSubscriptionBuilder for a given event
|
static <T extends Event> |
subscribe(Class<T> eventClass,
EventPriority priority)
Makes a SingleSubscriptionBuilder for a given event
|
@Nonnull public static <T extends Event> SingleSubscriptionBuilder<T> subscribe(@Nonnull Class<T> eventClass)
T - the event typeeventClass - the class of the eventSingleSubscriptionBuilder to construct the event handlerNullPointerException - if eventClass is null@Nonnull public static <T extends Event> SingleSubscriptionBuilder<T> subscribe(@Nonnull Class<T> eventClass, @Nonnull EventPriority priority)
T - the event typeeventClass - the class of the eventpriority - the priority to listen atSingleSubscriptionBuilder to construct the event handlerNullPointerException - if eventClass or priority is null@Nonnull public static <T> MergedSubscriptionBuilder<T> merge(@Nonnull Class<T> handledClass)
T - the super type classhandledClass - the super type of the event handlerMergedSubscriptionBuilder to construct the event handler@Nonnull public static <T> MergedSubscriptionBuilder<T> merge(@Nonnull TypeToken<T> type)
T - the super type classtype - the super type of the event handlerMergedSubscriptionBuilder to construct the event handler@Nonnull @SafeVarargs public static <S extends Event> MergedSubscriptionBuilder<S> merge(@Nonnull Class<S> superClass, @Nonnull Class<? extends S>... eventClasses)
S - the super class typesuperClass - the abstract super event classeventClasses - the event classes to be bound toMergedSubscriptionBuilder to construct the event handler@Nonnull @SafeVarargs public static <S extends Event> MergedSubscriptionBuilder<S> merge(@Nonnull Class<S> superClass, @Nonnull EventPriority priority, @Nonnull Class<? extends S>... eventClasses)
S - the super class typesuperClass - the abstract super event classpriority - the priority to listen ateventClasses - the event classes to be bound toMergedSubscriptionBuilder to construct the event handlerpublic static void call(@Nonnull Event event)
event - the event to callpublic static void callAsync(@Nonnull Event event)
event - the event to callpublic static void callSync(@Nonnull Event event)
event - the event to call@Nonnull public static <T extends Event> T callAndReturn(@Nonnull T event)
event - the event to call@Nonnull public static <T extends Event> T callAsyncAndJoin(@Nonnull T event)
event - the event to callCopyright © 2020. All rights reserved.