Interface ChangeWatcher.ChangeEvent<T>

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 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 of ChangeWatcher, though this may also be a different target. In case of Path, 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

      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, use ChangeEventType.CHANGED.
      Returns:
      type of change
    • create

      static <T> ChangeWatcher.ChangeEvent<T> create(T target, ChangeEventType type, Instant instant)
      Create a new change event.
      Type Parameters:
      T - type of the target
      Parameters:
      target - target of the change
      type - event type
      instant - time the event occurred
      Returns:
      a new typed change event
    • create

      static <T> ChangeWatcher.ChangeEvent<T> create(T target, ChangeEventType type)
      Create a new change event that occurred right now.
      Type Parameters:
      T - type of the target
      Parameters:
      target - target of the change
      type - event type
      Returns:
      a new typed change event