Skip to content

Commit

Permalink
Add Supplier based method for client completion keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dualspiral committed Dec 30, 2019
1 parent 39c4b6e commit 456239f
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ public interface CommandTreeBuilder<T extends CommandTreeBuilder<T>> {
*/
<S extends CommandTreeBuilder<S>> T child(String key, ClientCompletionKey<S> completionKey, Consumer<S> childNode);

/**
* Creates a child of this node with the given key that accepts a
* non-literal argument.
*
* <p>The builder returned by this method is the same builder as that
* invoked on. The child builder is provided in the {@code childNode}
* node.</p>
*
* @param key The name of the child node
* @param completionKey The {@link ClientCompletionKey} that indicates to
* the client how a tab completion should be handled.
* @return This, for chaining.
*/
default <S extends CommandTreeBuilder<S>> T child(String key, Supplier<ClientCompletionKey<S>> completionKey, Consumer<S> childNode) {
return child(key, completionKey, childNode);
}

/**
* Declares that this element will redirect processing to the given node
* <strong>after</strong> this node has been processed.
Expand Down

0 comments on commit 456239f

Please sign in to comment.