/* * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package java.nio.file; /** * An event or a repeated event for an object that is registered with a {@link * WatchService}. * *
An event is classified by its {@link #kind() kind} and has a {@link * #count() count} to indicate the number of times that the event has been * observed. This allows for efficient representation of repeated events. The * {@link #context() 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.
*
* @param This release does not define any standard modifiers.
*
* @since 1.7
* @see Watchable#register
*/
public static interface Modifier {
/**
* Returns the name of the modifier.
*/
String name();
}
/**
* Returns the event kind.
*
* @return the event kind
*/
Kind In the case of {@link StandardWatchEventKinds#ENTRY_CREATE ENTRY_CREATE},
* {@link StandardWatchEventKinds#ENTRY_DELETE ENTRY_DELETE}, and {@link
* StandardWatchEventKinds#ENTRY_MODIFY ENTRY_MODIFY} events the context is
* a {@code Path} that is the {@link Path#relativize relative} path between
* the directory registered with the watch service, and the entry that is
* created, deleted, or modified.
*
* @return the event context; may be {@code null}
*/
T context();
}