Package civitas.celestis.event
Class CancellableEvent
java.lang.Object
civitas.celestis.event.Event
civitas.celestis.event.CancellableEvent
- All Implemented Interfaces:
Cancellable,Handleable,Unique<UUID>
An event which can be cancelled by a lower priority listener, which flags
the event as cancelled, notifying higher priority listeners that this event
should be ignored as if it had not happened in the first place.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new cancellable event with a random unique identifier and no cause.CancellableEvent(Handleable cause) Creates a new cancellable event with a random unique identifier.CancellableEvent(UUID uniqueId) Creates a new cancellable event with no cause.CancellableEvent(UUID uniqueId, Handleable cause) Creates a new cancellable event. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this event has been flagged as cancelled.voidsetCancelled(boolean cancelled) Sets whether this event has been flagged as cancelled.Methods inherited from class civitas.celestis.event.Event
getCause, getUniqueId, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface civitas.celestis.event.Handleable
getCause, getUniqueId
-
Constructor Details
-
CancellableEvent
public CancellableEvent()Creates a new cancellable event with a random unique identifier and no cause. -
CancellableEvent
Creates a new cancellable event with no cause.- Parameters:
uniqueId- The unique identifier of this event
-
CancellableEvent
Creates a new cancellable event with a random unique identifier.- Parameters:
cause- The cause of this event
-
CancellableEvent
Creates a new cancellable event.- Parameters:
uniqueId- The unique identifier of this eventcause- The cause of this event
-
-
Method Details
-
isCancelled
public boolean isCancelled()Returns whether this event has been flagged as cancelled.- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif this event has been flagged as cancelled
-
setCancelled
public void setCancelled(boolean cancelled) Sets whether this event has been flagged as cancelled.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled- Whether this event has been cancelled
-