- Type Parameters:
T
- type of target
- Enclosing interface:
- ChangeWatcher<T>
public static interface ChangeWatcher.ChangeEvent<T>
A change event, carrying the target, type of change and time of change.
-
Method Summary
Modifier and TypeMethodDescriptionTime of change, or as close to that time as we can get.static <T> ChangeWatcher.ChangeEvent<T>
create
(T target, ChangeEventType type) Create a new change event that occurred right now.static <T> ChangeWatcher.ChangeEvent<T>
create
(T target, ChangeEventType type, Instant instant) Create a new change event.target()
Target of the change.type()
Type of change if available.
-
Method Details
-
changeTime
Instant changeTime()Time of change, or as close to that time as we can get.- Returns:
- instant of the change
-
target
T target()Target of the change. This may be the same as the target ofChangeWatcher
, though this may also be a different target. In case ofPath
, the change watcher may watch a directory, yet the change event notifies about a single file within that directory.- Returns:
- target that is changed
-
type
ChangeEventType type()Type of change if available. If no details can be found (e.g. we do not know if the target was deleted, created or modified, useChangeEventType.CHANGED
.- Returns:
- type of change
-
create
Create a new change event.- Type Parameters:
T
- type of the target- Parameters:
target
- target of the changetype
- event typeinstant
- time the event occurred- Returns:
- a new typed change event
-
create
Create a new change event that occurred right now.- Type Parameters:
T
- type of the target- Parameters:
target
- target of the changetype
- event type- Returns:
- a new typed change event
-