-
- 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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.function.Function<T,java.lang.String>getDisplayFunction()Get the function to convert items to display strings.default intgetMaxResults()Get the maximum number of results to display.default intgetMinSearchLength()Get the minimum number of characters required before searching.default java.lang.StringgetPlaceholder()Get the placeholder text to show when no search term is entered.java.util.function.Function<java.lang.String,java.util.List<T>>getSearchFunction()Get the search function that filters items based on the search term.java.util.function.Function<T,java.lang.String>getValueFunction()Get the function to convert items to their values.-
Methods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
-
-
-
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
-
-