Interface SearchBuilder<T>

  • Type Parameters:
    T - the type of items being searched
    All Superinterfaces:
    BaseBuilder<SearchBuilder<T>>
    All Known Implementing Classes:
    DefaultSearchBuilder

    public interface SearchBuilder<T>
    extends BaseBuilder<SearchBuilder<T>>
    Builder interface for search prompts.

    SearchBuilder extends BaseBuilder to provide a consistent fluent API for creating search prompts. The name() and message() methods are inherited from BaseBuilder, ensuring API consistency across all prompt types.

    See Also:
    BaseBuilder, SearchPrompt
    • Method Detail

      • searchFunction

        SearchBuilder<T> searchFunction​(java.util.function.Function<java.lang.String,​java.util.List<T>> searchFunction)
        Set the search function.
        Parameters:
        searchFunction - the function to search items
        Returns:
        this builder
      • displayFunction

        SearchBuilder<T> displayFunction​(java.util.function.Function<T,​java.lang.String> displayFunction)
        Set the display function.
        Parameters:
        displayFunction - the function to convert items to display strings
        Returns:
        this builder
      • valueFunction

        SearchBuilder<T> valueFunction​(java.util.function.Function<T,​java.lang.String> valueFunction)
        Set the value function.
        Parameters:
        valueFunction - the function to convert items to values
        Returns:
        this builder
      • placeholder

        SearchBuilder<T> placeholder​(java.lang.String placeholder)
        Set the placeholder text.
        Parameters:
        placeholder - the placeholder text
        Returns:
        this builder
      • minSearchLength

        SearchBuilder<T> minSearchLength​(int minSearchLength)
        Set the minimum search length.
        Parameters:
        minSearchLength - the minimum number of characters before searching
        Returns:
        this builder
      • maxResults

        SearchBuilder<T> maxResults​(int maxResults)
        Set the maximum number of results.
        Parameters:
        maxResults - the maximum results to display
        Returns:
        this builder