java.lang.Object
org.jline.prompt.impl.DefaultPrompt
org.jline.prompt.impl.DefaultSearchPrompt<T>
- All Implemented Interfaces:
Prompt,SearchPrompt<T>
Default implementation of SearchPrompt interface.
-
Field Summary
Fields inherited from class org.jline.prompt.impl.DefaultPrompt
message, name -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSearchPrompt(String name, String message, Function<String, List<T>> searchFunction, Function<T, String> displayFunction, Function<T, String> valueFunction) DefaultSearchPrompt(String name, String message, Function<String, List<T>> searchFunction, Function<T, String> displayFunction, Function<T, String> valueFunction, String placeholder, int minSearchLength, int maxResults) -
Method Summary
Modifier and TypeMethodDescriptionGet the function to convert items to display strings.intGet the maximum number of results to display.intGet the minimum number of characters required before searching.Get the placeholder text to show when no search term is entered.Get the search function that filters items based on the search term.Get the function to convert items to their values.Methods inherited from class org.jline.prompt.impl.DefaultPrompt
getFilter, getMessage, getName, getTransformer, setFilter, setTransformerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
Constructor Details
-
DefaultSearchPrompt
-
DefaultSearchPrompt
-
-
Method Details
-
getSearchFunction
Description copied from interface:SearchPromptGet the search function that filters items based on the search term.- Specified by:
getSearchFunctionin interfaceSearchPrompt<T>- Returns:
- the search function
-
getDisplayFunction
Description copied from interface:SearchPromptGet the function to convert items to display strings.- Specified by:
getDisplayFunctionin interfaceSearchPrompt<T>- Returns:
- the display function
-
getValueFunction
Description copied from interface:SearchPromptGet the function to convert items to their values.- Specified by:
getValueFunctionin interfaceSearchPrompt<T>- Returns:
- the value function
-
getPlaceholder
Description copied from interface:SearchPromptGet the placeholder text to show when no search term is entered.- Specified by:
getPlaceholderin interfaceSearchPrompt<T>- Returns:
- the placeholder text
-
getMinSearchLength
public int getMinSearchLength()Description copied from interface:SearchPromptGet the minimum number of characters required before searching.- Specified by:
getMinSearchLengthin interfaceSearchPrompt<T>- Returns:
- the minimum search length
-
getMaxResults
public int getMaxResults()Description copied from interface:SearchPromptGet the maximum number of results to display.- Specified by:
getMaxResultsin interfaceSearchPrompt<T>- Returns:
- the maximum results, or -1 for unlimited
-