Package org.incendo.cloud.help.result
Interface IndexCommandResult<C>
- Type Parameters:
C- the command sender type
- All Superinterfaces:
HelpQueryResult<C>,Iterable<CommandEntry<C>>
@Immutable
@API(status=STABLE)
public interface IndexCommandResult<C>
extends HelpQueryResult<C>, Iterable<CommandEntry<C>>
A list of commands.
This is the result of a query that doesn't point to a specific command or chain of commands.
The resulting entries() are likely to consist of all commands available to the sender,
but may also be empty in the case that no results were found.
-
Method Summary
Modifier and TypeMethodDescriptionentries()Returns an unmodifiable view of the entries.default booleanisEmpty()Returns whether the result is empty.default @NonNull Iterator<@NonNull CommandEntry<C>> iterator()Returns an iterator that iterates over theentries().static <C> @NonNull IndexCommandResult<C> Creates a new result.query()Returns the query.Methods inherited from interface org.incendo.cloud.help.result.HelpQueryResult
renderMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
of
static <C> @NonNull IndexCommandResult<C> of(@NonNull HelpQuery<C> query, @NonNull List<@NonNull CommandEntry<C>> entries) Creates a new result.- Type Parameters:
C- the command sender type- Parameters:
query- the query that prompted the resultentries- the entries that were found for the query- Returns:
- the result
-
query
Returns the query.- Specified by:
queryin interfaceHelpQueryResult<C>- Returns:
- the query
-
entries
@NonNull List<@NonNull CommandEntry<C>> entries()Returns an unmodifiable view of the entries.- Returns:
- the entries
-
isEmpty
@Parameter(false) default boolean isEmpty()Returns whether the result is empty.- Returns:
trueif there are no entries, elsefalse
-
iterator
Returns an iterator that iterates over theentries().
-