public abstract class ApplicationEvent extends EventObject
ApplicationListener
,
EventListener
,
Serialized Formsource
Constructor and Description |
---|
ApplicationEvent(Object source)
|
ApplicationEvent(Object source,
Clock clock)
Create a new
ApplicationEvent with its timestamp
set to the value returned by Clock.millis() in the provided Clock . |
Modifier and Type | Method and Description |
---|---|
long |
getTimestamp()
Return the time in milliseconds when the event occurred.
|
getSource, toString
public ApplicationEvent(Object source)
source
- the object on which the event initially occurred or with
which the event is associated (never null
)ApplicationEvent(Object, Clock)
public ApplicationEvent(Object source, Clock clock)
ApplicationEvent
with its timestamp
set to the value returned by Clock.millis()
in the provided Clock
.
This constructor is typically used in testing scenarios.
source
- the object on which the event initially occurred or with
which the event is associated (never null
)clock
- a clock which will provide the timestampApplicationEvent(Object)