Interface ListenerSubscriber.BulkSubscriber<K,E,O>
- Type Parameters:
K
- the key typeE
- the event typeO
- the order type
- Enclosing interface:
- ListenerSubscriber<K,
E, O>
public static interface ListenerSubscriber.BulkSubscriber<K,E,O>
An interface for subscribing multiple listeners at once.
-
Method Summary
Modifier and TypeMethodDescription<T extends E>
@NotNull ListenerSubscriber.BulkSubscriber<K,E, O> Adds a new listener for the specified event.<T extends E>
@NotNull ListenerSubscriber.BulkSubscriber<K,E, O> Adds a new listener for the specified event.<T extends E>
@NotNull ListenerSubscriber.BulkSubscriber<K,E, O> Adds a new listener for the specified event.@NotNull List<SubscribedListener<K,
? extends E, O>> Subscribes added listeners.
-
Method Details
-
add
@Contract("_, _ -> this") @NotNull <T extends E> @NotNull ListenerSubscriber.BulkSubscriber<K,E, addO> (@NotNull @NotNull Class<T> eventClass, @NotNull @NotNull Consumer<? super ListenerFactory<K, T, O>> builder) Adds a new listener for the specified event.- Type Parameters:
T
- the event type- Parameters:
eventClass
- the class of the eventbuilder
- theConsumer
to modifyListenerFactory
- Returns:
- this
ListenerSubscriber.BulkSubscriber
-
add
@Contract("_, _, _ -> this") @NotNull <T extends E> @NotNull ListenerSubscriber.BulkSubscriber<K,E, addO> (@NotNull @NotNull Class<T> eventClass, @NotNull K key, @NotNull @NotNull Consumer<? super T> consumer) Adds a new listener for the specified event.- Type Parameters:
T
- the event type- Parameters:
eventClass
- the class of the eventkey
- the keyconsumer
- theConsumer
- Returns:
- this
ListenerSubscriber.BulkSubscriber
-
add
@Contract("_, _, _, _ -> this") @NotNull <T extends E> @NotNull ListenerSubscriber.BulkSubscriber<K,E, addO> (@NotNull @NotNull Class<T> eventClass, @NotNull K key, @NotNull @NotNull Consumer<? super T> consumer, @Nullable O order) Adds a new listener for the specified event.- Type Parameters:
T
- the event type- Parameters:
eventClass
- the class of the eventkey
- the keyconsumer
- theConsumer
order
- the order, passingnull
to use a default order- Returns:
- this
ListenerSubscriber.BulkSubscriber
-
subscribe
Subscribes added listeners.- Returns:
SubscribedListener
s
-