- Type Parameters:
T- the type of items being searched
- All Superinterfaces:
BaseBuilder<SearchBuilder<T>>
- All Known Implementing Classes:
DefaultSearchBuilder
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:
-
Method Summary
Modifier and TypeMethodDescriptiondisplayFunction(Function<T, String> displayFunction) Set the display function.maxResults(int maxResults) Set the maximum number of results.minSearchLength(int minSearchLength) Set the minimum search length.placeholder(String placeholder) Set the placeholder text.searchFunction(Function<String, List<T>> searchFunction) Set the search function.valueFunction(Function<T, String> valueFunction) Set the value function.Methods inherited from interface org.jline.prompt.BaseBuilder
addPrompt, filter, message, name, transformer
-
Method Details
-
searchFunction
Set the search function.- Parameters:
searchFunction- the function to search items- Returns:
- this builder
-
displayFunction
Set the display function.- Parameters:
displayFunction- the function to convert items to display strings- Returns:
- this builder
-
valueFunction
Set the value function.- Parameters:
valueFunction- the function to convert items to values- Returns:
- this builder
-
placeholder
Set the placeholder text.- Parameters:
placeholder- the placeholder text- Returns:
- this builder
-
minSearchLength
Set the minimum search length.- Parameters:
minSearchLength- the minimum number of characters before searching- Returns:
- this builder
-
maxResults
Set the maximum number of results.- Parameters:
maxResults- the maximum results to display- Returns:
- this builder
-