Class AbstractEvent<T extends java.lang.Enum,​S>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractEvent​(T type, S subject)
      Creates an event of a given type and for the specified subject and the current time.
      protected AbstractEvent​(T type, S subject, long time)
      Creates an event of a given type and for the specified subject and time.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      S subject()
      Returns the subject of the event.
      long time()
      Returns the timestamp of when the event occurred, given in milliseconds since the start of epoch.
      java.lang.String toString()  
      T type()
      Returns the type of the event.
      • Methods inherited from class java.lang.Object

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

      • AbstractEvent

        protected AbstractEvent​(T type,
                                S subject)
        Creates an event of a given type and for the specified subject and the current time.
        Parameters:
        type - event type
        subject - event subject
      • AbstractEvent

        protected AbstractEvent​(T type,
                                S subject,
                                long time)
        Creates an event of a given type and for the specified subject and time.
        Parameters:
        type - event type
        subject - event subject
        time - occurrence time
    • Method Detail

      • time

        public long time()
        Description copied from interface: Event
        Returns the timestamp of when the event occurred, given in milliseconds since the start of epoch.
        Specified by:
        time in interface Event<T extends java.lang.Enum,​S>
        Returns:
        timestamp in milliseconds
      • type

        public T type()
        Description copied from interface: Event
        Returns the type of the event.
        Specified by:
        type in interface Event<T extends java.lang.Enum,​S>
        Returns:
        event type
      • subject

        public S subject()
        Description copied from interface: Event
        Returns the subject of the event.
        Specified by:
        subject in interface Event<T extends java.lang.Enum,​S>
        Returns:
        subject to which this event pertains
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object