Class Suggestions

java.lang.Object
dev.polv.taleapi.command.suggestion.Suggestions

public final class Suggestions extends Object
A collection of suggestions for command autocompletion.
  • Constructor Details

    • Suggestions

      public Suggestions(StringRange range, List<Suggestion> suggestions)
      Creates a new Suggestions instance.
      Parameters:
      range - the range these suggestions cover
      suggestions - the list of suggestions
  • Method Details

    • empty

      public static Suggestions empty()
      Returns an empty suggestions instance.
      Returns:
      empty suggestions
    • merge

      public static Suggestions merge(String input, Collection<Suggestions> suggestions)
      Merges multiple suggestions into one.
      Parameters:
      input - the input string
      suggestions - the suggestions to merge
      Returns:
      merged suggestions
    • getRange

      public StringRange getRange()
      Returns the range these suggestions cover.
      Returns:
      the range
    • getList

      public List<Suggestion> getList()
      Returns the list of suggestions.
      Returns:
      the suggestions
    • isEmpty

      public boolean isEmpty()
      Checks if there are no suggestions.
      Returns:
      true if empty
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object