Class HelpQuery.Builder<S extends Source>
java.lang.Object
studio.mevera.imperat.command.tree.help.HelpQuery.Builder<S>
- Type Parameters:
S- The type ofSource.
A builder class for creating instances of
HelpQuery.
This class uses a fluent API to allow for easy and readable configuration of a help query with optional parameters.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an immutableHelpQueryinstance with the configured parameters.conditionalRootUsage(Predicate<CommandUsage<S>> rootUsagePredicate) Sets the condition for including the root's MAINcommand usage.filter(@NotNull HelpFilter<S> filter) Adds a filter to the queue of filters.limit(int limit) Sets the maximum number of help entries to return.maxDepth(int depth) Sets the maximum depth to traverse the command tree.
-
Method Details
-
maxDepth
Sets the maximum depth to traverse the command tree.- Parameters:
depth- The maximum depth.- Returns:
- This builder instance.
-
limit
Sets the maximum number of help entries to return.- Parameters:
limit- The limit.- Returns:
- This builder instance.
-
conditionalRootUsage
Sets the condition for including the root's MAINcommand usage.- Parameters:
rootUsagePredicate- the condition/predicate to include the root.- Returns:
- This builder instance.
-
filter
Adds a filter to the queue of filters.- Parameters:
filter- The filter to add.- Returns:
- This builder instance.
-
build
Builds an immutableHelpQueryinstance with the configured parameters.- Returns:
- A new
HelpQuery.
-