Interface SafeSuggestions<S,CommandSender>

Type Parameters:
S - the type of the suggestions
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SafeSuggestions<S,CommandSender>
This class represents safe suggestions. These are parameterized suggestions which can be converted into a string under a mapping function. SafeSuggestions instances are best created using the static methods as opposed to functionally.
  • Method Details

    • toSuggestions

      Convert this SafeSuggestions object into an ArgumentSuggestions by mapping the values with a string mapping function.
      Parameters:
      mapper - a function which maps an instance of SafeSuggestions to a string.
      Returns:
      an ArgumentSuggestions object resulting from this mapping.
    • empty

      static <T, CommandSender> SafeSuggestions<T,CommandSender> empty()
      Create an empty SafeSuggestions object.
      Type Parameters:
      T - type parameter of the SafeSuggestions object
      Returns:
      a SafeSuggestions object resulting in empty suggestions
    • suggest

      @SafeVarargs static <T, CommandSender> SafeSuggestions<T,CommandSender> suggest(T... suggestions)
      Hardcode an array of values to suggest
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - array of hardcoded values
      Returns:
      a SafeSuggestions object suggesting the hardcoded suggestions
    • suggest

      static <T, CommandSender> SafeSuggestions<T,CommandSender> suggest(Collection<T> suggestions)
      Hardcode a collection of values to suggest
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - collection of hardcoded values
      Returns:
      a SafeSuggestions object suggesting the hardcoded suggestions
    • suggest

      static <T, CommandSender> SafeSuggestions<T,CommandSender> suggest(Function<SuggestionInfo<CommandSender>,T[]> suggestions)
      Suggest an array of values as the result of a function
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - function providing the array of values
      Returns:
      a SafeSuggestion object suggesting the result of the function
    • suggestCollection

      static <T, CommandSender> SafeSuggestions<T,CommandSender> suggestCollection(Function<SuggestionInfo<CommandSender>,Collection<T>> suggestions)
      Suggest a collection of values as the result of a function
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - function providing the collection of values
      Returns:
      a SafeSuggestion object suggesting the result of the function
    • suggestAsync

      static <T, CommandSender> SafeSuggestions<T,CommandSender> suggestAsync(Function<SuggestionInfo<CommandSender>,CompletableFuture<T[]>> suggestions)
      Suggest an array of values provided asynchronously
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - function providing the array of values asynchronously
      Returns:
      a SafeSuggestion object suggestion the result of the asynchronous function
    • suggestCollectionAsync

      static <T, CommandSender> SafeSuggestions<T,CommandSender> suggestCollectionAsync(Function<SuggestionInfo<CommandSender>,CompletableFuture<Collection<T>>> suggestions)
      Suggest a collection of values provided asynchronously
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - function providing the collection of values asynchronously
      Returns:
      a SafeSuggestion object suggestion the result of the asynchronous function
    • tooltips

      @SafeVarargs static <T, CommandSender> SafeSuggestions<T,CommandSender> tooltips(Tooltip<T>... suggestions)
      Suggest an array of hardcoded values with tooltips
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - array of hardcoded values with their tooltips
      Returns:
      a SafeSuggestion object suggesting the hardcoded values
    • tooltips

      static <T, CommandSender> SafeSuggestions<T,CommandSender> tooltips(Collection<Tooltip<T>> suggestions)
      Suggest a collection of hardcoded values with tooltips
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - collection of hardcoded values with their tooltips
      Returns:
      a SafeSuggestion object suggesting the hardcoded values
    • tooltips

      static <T, CommandSender> SafeSuggestions<T,CommandSender> tooltips(Function<SuggestionInfo<CommandSender>,Tooltip<T>[]> suggestions)
      Suggest an array of values with tooltips as the result of a function
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - function providing the array of values with tooltips
      Returns:
      a SafeSuggestion object suggesting the result of the function
    • tooltipCollection

      static <T, CommandSender> SafeSuggestions<T,CommandSender> tooltipCollection(Function<SuggestionInfo<CommandSender>,Collection<Tooltip<T>>> suggestions)
      Suggest a collection of values with tooltips as the result of a function
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - function providing the collection of values with tooltips
      Returns:
      a SafeSuggestion object suggesting the result of the function
    • tooltipsAsync

      static <T, CommandSender> SafeSuggestions<T,CommandSender> tooltipsAsync(Function<SuggestionInfo<CommandSender>,CompletableFuture<Tooltip<T>[]>> suggestions)
      Suggest an array of values with tooltips asynchronously
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - function providing the collection of values with tooltips asynchronously
      Returns:
      a SafeSuggestion suggesting the result of the asynchronous function
    • tooltipCollectionAsync

      static <T, CommandSender> SafeSuggestions<T,CommandSender> tooltipCollectionAsync(Function<SuggestionInfo<CommandSender>,CompletableFuture<Collection<Tooltip<T>>>> suggestions)
      Suggest a collection of values with tooltips asynchronously
      Type Parameters:
      T - type of the values
      Parameters:
      suggestions - function providing the array of values with tooltips asynchronously
      Returns:
      a SafeSuggestion suggesting the result of the asynchronous function