Package dev.majek.hexnicks.util
Class TabCompleterBase
java.lang.Object
dev.majek.hexnicks.util.TabCompleterBase
Handles some static utility methods available to tab completer.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfilterStartingWith
(String prefix, Collection<String> strings) Filters the given string list by removing null or empty strings, or strings who do not start with the given prefix (ignoring case).filterStartingWith
(String prefix, Stream<String> stream) Filters the given stream by removing null or empty strings, or strings who do not start with the given prefix (ignoring case).getOnlinePlayers
(String partialName) Returns a list of the currently online players whose name starts with the given partial name.static String
joinArgsBeyond
(int index, String delim, String[] args) Joins all the arguments after the argument at the given index with the given delimiter.
-
Constructor Details
-
TabCompleterBase
public TabCompleterBase()
-
-
Method Details
-
getOnlinePlayers
Returns a list of the currently online players whose name starts with the given partial name.- Parameters:
partialName
- the partial name.- Returns:
- a list of the currently online players whose name starts with the given partial name.
-
joinArgsBeyond
Joins all the arguments after the argument at the given index with the given delimiter.- Parameters:
index
- the index.delim
- the delimiter.args
- the arguments.- Returns:
- the result of joining the argument after the given index with the given delimiter.
-
filterStartingWith
Filters the given stream by removing null or empty strings, or strings who do not start with the given prefix (ignoring case).- Parameters:
prefix
- the prefix to match.stream
- the stream to filter.- Returns:
- the list of values left after the stream has been filtered.
-
filterStartingWith
Filters the given string list by removing null or empty strings, or strings who do not start with the given prefix (ignoring case). This method is equivalent to calling filterStartingWith(prefix, strings.stream()).- Parameters:
prefix
- the prefix to match.strings
- the strings to filter.- Returns:
- the list of values left after the strings have been filtered.
-