Class AbstractEvent<T extends Enum,S>

java.lang.Object
io.atomix.utils.event.AbstractEvent<T,S>
All Implemented Interfaces:
Event<T,S>

public class AbstractEvent<T extends Enum,S> extends Object implements Event<T,S>
Base event implementation.
  • 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

    Modifier and Type
    Method
    Description
    Returns the subject of the event.
    long
    Returns the timestamp of when the event occurred, given in milliseconds since the start of epoch.
     
    Returns the type of the event.

    Methods inherited from class java.lang.Object

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

    • 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 Details

    • 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 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 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 Enum,S>
      Returns:
      subject to which this event pertains
    • toString

      public String toString()
      Overrides:
      toString in class Object