public class AbstractEvent<T extends java.lang.Enum,S> extends java.lang.Object implements Event<T,S>
| Modifier | Constructor and 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.
|
| Modifier and Type | Method and 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.
|
protected AbstractEvent(T type, S subject)
type - event typesubject - event subjectpublic long time()
Eventpublic S subject()
Eventpublic java.lang.String toString()
toString in class java.lang.Object