ReturnableEvent

abstract class ReturnableEvent<T> : Event

Represents an event that can return a result.

Parameters

T

The type of the result.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The metadata of the event. This can be used to store additional information about the event.

Link copied to clipboard
var result: T?

The result of the event.

Functions

Link copied to clipboard
fun getMeta(key: String): Any?

Gets a metadata value by key.

Link copied to clipboard
fun <T> getMetaOrDefault(key: String, default: T): T

Gets a metadata value by key or a default value if the value is null.

Link copied to clipboard
fun getResultOrDefault(default: T): T

Gets the result of the event or a default value if the result is null.

Link copied to clipboard
fun setMeta(key: String, value: Any): Any?

Sets a metadata key-value pair.

Link copied to clipboard
fun setResult(result: T)

Sets the result of the event.