Interface SearchPrompt<T>

All Superinterfaces:
Prompt
All Known Implementing Classes:
DefaultSearchPrompt

public interface SearchPrompt<T> extends Prompt
Interface for search prompts. A search prompt allows users to search through a list of items dynamically.
  • Method Details

    • getSearchFunction

      Function<String,List<T>> getSearchFunction()
      Get the search function that filters items based on the search term.
      Returns:
      the search function
    • getDisplayFunction

      Function<T,String> getDisplayFunction()
      Get the function to convert items to display strings.
      Returns:
      the display function
    • getValueFunction

      Function<T,String> getValueFunction()
      Get the function to convert items to their values.
      Returns:
      the value function
    • getPlaceholder

      default String getPlaceholder()
      Get the placeholder text to show when no search term is entered.
      Returns:
      the placeholder text
    • getMinSearchLength

      default int getMinSearchLength()
      Get the minimum number of characters required before searching.
      Returns:
      the minimum search length
    • getMaxResults

      default int getMaxResults()
      Get the maximum number of results to display.
      Returns:
      the maximum results, or -1 for unlimited