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 Detail

      • getSearchFunction

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

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

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

        default java.lang.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