Make docs on ValueParameterModifier clearer.
Also make modifyCompletion a default method to return the same list.
*
* <p>These modifier methods are provided the same information as the original
* parameter, along with the result of the original parameter - that is, these
- * modifiers run <strong>after</strong> the associated parameter has run.</p>
+ * modifiers run <strong>after</strong> the associated parameter has run. The
+ * main takeaway here is that modifiers <strong>cannot</strong> add new entries
+ * to the parameter, only modify what they return and filter out entries that
+ * are not supported by your operation.</p>
*
* <p><strong>Modifiers are not designed to transform the returned type</strong>
* - this is to maintain the integrity of the key typing and to discourage
* would be better to process the parsed result in the body of your executor
* instead.</li>
* </ul>
+ *
+ * <p>With all this in mind, modifiers should be used sparingly, preferring the
+ * use of other constructs when at all possible.</p>
*/
public interface ValueParameterModifier<T> {
* @param completions The completions suggested by the chained parameter
* @return The modified completions
*/
- List<String> modifyCompletion(
- final CommandContext context, final String currentInput, final List<String> completions);
+ default List<String> modifyCompletion(
+ final CommandContext context, final String currentInput, final List<String> completions) {
+ return completions;
+ }
/**
* Modifies the message provided in a {@link ArgumentParseException} if the
