com.h3c.util.event

## Class AbstractTypedEvent<T extends Enum<?>>

- java.lang.Object
- - com.h3c.util.event.AbstractTypedEvent<T>

- Type Parameters:
    `T` - Event type class
  All Implemented Interfaces:
    Event, TypedEvent<T>

      public abstract class AbstractTypedEvent<T extends Enum<?>>
      extends Object
      implements TypedEvent<T>

  A base implementation of `TypedEvent`.

  It is expected that concrete subclasses are designed to be immutable.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTypedEvent(T type)` Constructs a typed event.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected TimeUtils` | `time()` Returns the `TimeUtils` instance used to time stamp the event.
    `String` | `toString()`
    `long` | `ts()` Returns the event timestamp - when it happened.
    `T` | `type()` Returns the type of event - what happened.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractTypedEvent

          public AbstractTypedEvent(T type)

      Constructs a typed event.
      Parameters:
        `type` - the type of event

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### ts

          public long ts()

      Description copied from interface: `TypedEvent`
      Returns the event timestamp - when it happened.

      The timestamp is set to `System.currentTimeMillis()` at the time the event was created.

      Specified by:
        `ts` in interface `TypedEvent<T extends Enum<?>>`
      Returns:
        the timestamp

    - #### type

          public T type()

      Description copied from interface: `TypedEvent`
      Returns the type of event - what happened.
      Specified by:
        `type` in interface `TypedEvent<T extends Enum<?>>`
      Returns:
        the event type

    - #### time

          protected TimeUtils time()

      Returns the `TimeUtils` instance used to time stamp the event.
      Returns:
        the time utils instance
      See Also:
        `TimeUtils`

Copyright © 2014. All Rights Reserved.