@@ -75,6 +75,7 @@ private Watch(Path path, WatchScope scope) {
75
75
* @param path which absolute path to monitor, can be a file or a directory, but has to be absolute
76
76
* @param scope for directories you can also choose to monitor it's direct children or all it's descendants
77
77
* @throws IllegalArgumentException in case a path is not supported (in relation to the scope)
78
+ * @return watch builder that can be further configured and then started
78
79
*/
79
80
public static Watch build (Path path , WatchScope scope ) {
80
81
if (!path .isAbsolute ()) {
@@ -103,7 +104,7 @@ public static Watch build(Path path, WatchScope scope) {
103
104
* Use the {@link #withExecutor(Executor)} function to influence the sequencing of these events.
104
105
* By default they can arrive in parallel.
105
106
* @param eventHandler a callback that handles the watch event, will be called once per event.
106
- * @return this for optional method chaining
107
+ * @return {@code this} (to support method chaining)
107
108
*/
108
109
public Watch on (Consumer <WatchEvent > eventHandler ) {
109
110
if (this .eventHandler != EMPTY_HANDLER ) {
@@ -115,6 +116,8 @@ public Watch on(Consumer<WatchEvent> eventHandler) {
115
116
116
117
/**
117
118
* Convenience variant of {@link #on(Consumer)}, which allows you to only respond to certain events
119
+ * @param listener gets executed on every event the watch produced
120
+ * @return {@code this} (to support method chaining)
118
121
*/
119
122
public Watch on (WatchEventListener listener ) {
120
123
if (this .eventHandler != EMPTY_HANDLER ) {
0 commit comments