Class Event<H>

  • Type Parameters:
    H - interface implemented by handlers of this kind of event
    Direct Known Subclasses:
    EntityProxyChange, GwtEvent

    public abstract class Event<H>
    extends java.lang.Object
    Base Event object.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Event.Type<H>
      Type class used to register events with an EventBus.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Event()
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void dispatch​(H handler)
      Implemented by subclasses to to invoke their handlers in a type safe manner.
      abstract Event.Type<H> getAssociatedType()
      Returns the Event.Type used to register this event, allowing an EventBus to find handlers of the appropriate class.
      java.lang.Object getSource()
      Returns the source for this event.
      protected void setSource​(java.lang.Object source)
      Set the source that triggered this event.
      java.lang.String toDebugString()
      This is a method used primarily for debugging.
      java.lang.String toString()
      The toString() for abstract event is overridden to avoid accidently including class literals in the compiled output.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Event

        protected Event()
        Constructor.
    • Method Detail

      • getAssociatedType

        public abstract Event.Type<H> getAssociatedType()
        Returns the Event.Type used to register this event, allowing an EventBus to find handlers of the appropriate class.
        Returns:
        the type
      • toDebugString

        public java.lang.String toDebugString()
        This is a method used primarily for debugging. It gives a string representation of the event details. This does not override the toString method because the compiler cannot always optimize toString out correctly. Event types should override as desired.
        Returns:
        a string representing the event's specifics.
      • toString

        public java.lang.String toString()
        The toString() for abstract event is overridden to avoid accidently including class literals in the compiled output. Use Event #toDebugString to get more information about the event.
        Overrides:
        toString in class java.lang.Object