aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/geb/api/IEventCancelable.java
blob: c6630a1d62c204e23a197ccc7fdfa4e414994a2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package ftbsc.geb.api;

/**
 * The common interface for all cancelable GEB events.
 * @since 0.1.0
 */
public interface IEventCancelable extends IEvent {
   /**
    * Checks whether the event was canceled; any user-defined
    * implementation will be ignored.
    * @return whether the event was canceled
    */
   default boolean isCanceled() {
      return false;
   }

   /**
    * Cancels the event.
    * Any user-defined implementation will be ignored.
    */
   default void setCanceled() {
      this.setCanceled(true);
   }

   /**
    * Cancels the event.
    * Any user-defined implementation will be ignored.
    * @param canceled whether the event should be set to canceled
    */
   default void setCanceled(boolean canceled) {}
}