Interface ICancellableEvent


public interface ICancellableEvent
Interface for events that can be canceled. Listeners registered to the event bus will not receive canceled events, unless they were registered with receiveCanceled = true.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns the canceled state of this event.
    default void
    setCanceled(boolean canceled)
    Sets the cancel state of this event.
  • Method Details

    • setCanceled

      @MustBeInvokedByOverriders default void setCanceled(boolean canceled)
      Sets the cancel state of this event.

      This will prevent other listeners from receiving this event unless they were registered with receiveCanceled = true. Further effects of setting the cancel state are defined on a per-event basis.

      This method may be overridden to react to cancellation of the event, however a super call must always be made as follows: ICancellableEvent.super.setCanceled(canceled);

    • isCanceled

      @NonExtendable default boolean isCanceled()
      Returns the canceled state of this event.
      Returns:
      the canceled state of this event