-
- 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
BaseBuilderto 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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SearchBuilder<T>displayFunction(java.util.function.Function<T,java.lang.String> displayFunction)Set the display function.SearchBuilder<T>maxResults(int maxResults)Set the maximum number of results.SearchBuilder<T>minSearchLength(int minSearchLength)Set the minimum search length.SearchBuilder<T>placeholder(java.lang.String placeholder)Set the placeholder text.SearchBuilder<T>searchFunction(java.util.function.Function<java.lang.String,java.util.List<T>> searchFunction)Set the search function.SearchBuilder<T>valueFunction(java.util.function.Function<T,java.lang.String> valueFunction)Set the value function.-
Methods inherited from interface org.jline.prompt.BaseBuilder
addPrompt, filter, message, name, transformer
-
-
-
-
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
-
-