# WatchEvent

public interface **WatchEvent** An event or a repeated event for an object that is registered with a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchService.html`.

An event is classified by its `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.html#kind()` and has a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.html#count()` to indicate the number of times that the event has been
observed. This allows for efficient representation of repeated events. The
`https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.html#context()` method returns any context associated with
the event. In the case of a repeated event then the context is the same for
all events.

Watch events are immutable and safe for use by multiple concurrent
threads.

### Nested Class Summary

|---|---|---|---|
| interface | [WatchEvent.Kind](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.Kind.html)\<T\> || An event kind, for the purposes of identification. |
| interface | [WatchEvent.Modifier](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.Modifier.html) || An event modifier that qualifies how a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/Watchable.html` is registered with a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchService.html`. |

### Public Method Summary

|---|---|
| abstract T | [context](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.html#context())() Returns the context for the event. |
| abstract int | [count](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.html#count())() Returns the event count. |
| abstract [Kind](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.Kind.html)\<T\> | [kind](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.html#kind())() Returns the event kind. |

## Public Methods

#### public abstract T
**context**
()

Returns the context for the event.

In the case of `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/StandardWatchEventKinds.html#ENTRY_CREATE`,
`https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/StandardWatchEventKinds.html#ENTRY_DELETE`, and `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/StandardWatchEventKinds.html#ENTRY_MODIFY` events the context is
a `Path` that is the `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/Path.html#relativize(java.nio.file.Path)` path between
the directory registered with the watch service, and the entry that is
created, deleted, or modified.

##### Returns

- the event context; may be `null`

#### public abstract int
**count**
()

Returns the event count. If the event count is greater than `1`
then this is a repeated event.

##### Returns

- the event count

#### public abstract [Kind](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/WatchEvent.Kind.html)\<T\>
**kind**
()

Returns the event kind.

##### Returns

- the event kind