Annotation Type Flag
-
@Target(PARAMETER) @Retention(RUNTIME) public @interface FlagIndicates that the parameter should be treated like aCommandFlag.- If the parameter is a
boolean, a presence flag will be created - If the parameter is of any other type, a value flag will be created and the parser
will resolve it in the same way that it would for an
Argument
- If the parameter is a
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description @NonNull java.lang.StringvalueThe flag name
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description @NonNull java.lang.String[]aliasesFlag aliases@NonNull java.lang.StringdescriptionThe argument description@NonNull java.lang.StringparserNameName of the parser.@NonNull java.lang.StringsuggestionsName of the suggestions provider to use.
-
-
-
-
suggestions
@NonNull java.lang.String suggestions
Name of the suggestions provider to use. If the string is left empty, the default provider for the argument parser will be used. Otherwise, theParserRegistryinstance in theCommandManagerwill be queried for a matching suggestion provider.For this to work, the suggestion needs to be registered in the parser registry. To do this, use
ParserRegistry.registerSuggestionProvider(String, BiFunction). The registry instance can be retrieved usingCommandManager.getParserRegistry().- Returns:
- The name of the suggestion provider, or
""if the default suggestion provider for the argument parser should be used instead - Since:
- 1.2.0
- Default:
- ""
-
-