Package org.incendo.cloud.help
Class StandardHelpHandler<C>
java.lang.Object
org.incendo.cloud.help.StandardHelpHandler<C>
- All Implemented Interfaces:
HelpHandler<C>
-
Constructor Summary
ConstructorsConstructorDescriptionStandardHelpHandler(@NonNull CommandManager<C> commandManager, @NonNull CommandPredicate<C> commandPredicate) Creates a new help handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull List<@NonNull CommandEntry<C>> Returns entries for all commands that are applicable to this handler.protected booleanisNodeVisible(@NonNull CommandNode<C> node) Checks using the predicate whether a command node or one of its children is visibleHandles the givenqueryand returns the result.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.incendo.cloud.help.HelpHandler
queryRootIndex
-
Constructor Details
-
StandardHelpHandler
public StandardHelpHandler(@NonNull CommandManager<C> commandManager, @NonNull CommandPredicate<C> commandPredicate) Creates a new help handler.- Parameters:
commandManager- the command manager to get commands fromcommandPredicate- filter that determines which commands are applicable
-
-
Method Details
-
query
Handles the givenqueryand returns the result.If nothing matched the query, an empty
IndexCommandResultwill be returned.- Specified by:
queryin interfaceHelpHandler<C>- Parameters:
query- the query- Returns:
- the result
-
commands
Returns entries for all commands that are applicable to this handler.- Parameters:
sender- the sender of the query- Returns:
- the help entries
-
isNodeVisible
Checks using the predicate whether a command node or one of its children is visible- Parameters:
node- the node- Returns:
trueif the node is visible,falseif it isn't
-