Class Suggestions
java.lang.Object
dev.polv.taleapi.command.suggestion.Suggestions
A collection of suggestions for command autocompletion.
-
Constructor Summary
ConstructorsConstructorDescriptionSuggestions(StringRange range, List<Suggestion> suggestions) Creates a new Suggestions instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic Suggestionsempty()Returns an empty suggestions instance.booleangetList()Returns the list of suggestions.getRange()Returns the range these suggestions cover.inthashCode()booleanisEmpty()Checks if there are no suggestions.static Suggestionsmerge(String input, Collection<Suggestions> suggestions) Merges multiple suggestions into one.toString()
-
Constructor Details
-
Suggestions
Creates a new Suggestions instance.- Parameters:
range- the range these suggestions coversuggestions- the list of suggestions
-
-
Method Details
-
empty
Returns an empty suggestions instance.- Returns:
- empty suggestions
-
merge
Merges multiple suggestions into one.- Parameters:
input- the input stringsuggestions- the suggestions to merge- Returns:
- merged suggestions
-
getRange
Returns the range these suggestions cover.- Returns:
- the range
-
getList
Returns the list of suggestions.- Returns:
- the suggestions
-
isEmpty
public boolean isEmpty()Checks if there are no suggestions.- Returns:
trueif empty
-
equals
-
hashCode
public int hashCode() -
toString
-