Builder

interface Builder<T : Event>

A builder for an event listener.

Functions

Link copied to clipboard
abstract fun addFilter(filter: Predicate<T>): EventListener.Builder<T>

Adds the given filter to the list of filters that will be checked when an event is passed to the listener.

Link copied to clipboard
abstract fun build(): EventListener<T>

Builds the event listener from this builder.

Link copied to clipboard
abstract fun expireCount(count: Int): EventListener.Builder<T>

Sets the number of times the listener can be ran before it is considered expired, and will not run anymore.

Link copied to clipboard
abstract fun expireWhen(condition: Predicate<T>): EventListener.Builder<T>

Sets the condition that, if met, will cause the listener to be considered expired, and not have it run anymore.

Link copied to clipboard
abstract fun handler(handler: Consumer<T>): EventListener.Builder<T>

Sets the handler for the listener.

Link copied to clipboard

Sets whether or not the listener should ignore events that have been denied.