CancelableEvent

public abstract class CancelableEvent extends Event

Represents an event that can be canceled.

Constructors

Link copied to clipboard

Properties

Link copied to clipboard
private final Boolean isCanceled

Indicates whether the event is canceled.

Link copied to clipboard
@Deprecated(message = "I think Event class constructor is more useful than this system.")
private final Map<String, Object> metadata

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

Functions

Link copied to clipboard
public final Unit cancel()

Cancels the event.

Link copied to clipboard
public final Object getMeta(String key)

Gets a metadata value by key.

Link copied to clipboard
public final Map<String, Object> getMetadata()

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

Link copied to clipboard
public final T getMetaOrDefault<T extends Any>(String key, T default)

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

Link copied to clipboard
public final Boolean isCanceled()

Indicates whether the event is canceled.

Link copied to clipboard
public final Unit reset()

Uncancels the event.

Link copied to clipboard
public final Object setMeta(String key, Object value)

Sets a metadata key-value pair.