Class Event

java.lang.Object
me.wouterkistemaker.eventmanager.Event
All Implemented Interfaces:
Handleable

public abstract class Event extends Object implements Handleable
The default implementation of Handleable. Events can be called to an event manager in order to be processed by listeners.
See Also:
  • Field Details

    • cause

      @Nullable protected final Handleable cause
      The cause of this event.
      Since:
      1.1
  • Constructor Details

    • Event

      protected Event()
      Creates a new event with no specified cause.
    • Event

      protected Event(@Nullable Handleable cause)
      Creates a new event.
      Parameters:
      cause - The cause of this event
      Since:
      1.1
  • Method Details

    • getCause

      @Nullable public Handleable getCause()
      Returns the cause of this event. If no cause is specified, this will return null.
      Specified by:
      getCause in interface Handleable
      Returns:
      The cause of this event if specified, null otherwise
      Since:
      1.1
    • getName

      public String getName()
      This method allows you to get the name of the Event

      This can be overridden by a superclass, but preferably not because this would cause events being named quite differently from another Event !

      Returns:
      String name of the Event
    • getDescription

      public abstract String getDescription()
      Method to get the description of a specific Event. Each Event has its own description.
      Returns:
      String the description of the Event