Package org.aesh.readline
Class ReadlineRequest.Builder
java.lang.Object
org.aesh.readline.ReadlineRequest.Builder
- Enclosing class:
ReadlineRequest
Builder for constructing
ReadlineRequest instances.
The connection(Connection), prompt(Prompt), and
requestHandler(Consumer) fields are required.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newReadlineRequestfrom this builder's configuration.completions(List<Completion> completions) Sets the list of completions for tab completion.connection(Connection connection) Sets the terminal connection (required).cursorListener(CursorListener cursorListener) Sets the cursor listener to receive cursor movement events.flags(EnumMap<ReadlineFlag, Integer> flags) Sets the readline flags controlling behavior.Sets the history instance to use for this readline operation.Sets the list of input pre-processors.Sets the prompt to display using a string (required).Sets the prompt to display (required).requestHandler(Consumer<String> requestHandler) Sets the callback to receive the completed input line (required).
-
Method Details
-
connection
Sets the terminal connection (required).- Parameters:
connection- the terminal connection- Returns:
- this builder
-
prompt
Sets the prompt to display (required).- Parameters:
prompt- the prompt- Returns:
- this builder
-
prompt
Sets the prompt to display using a string (required).- Parameters:
prompt- the prompt string- Returns:
- this builder
-
requestHandler
Sets the callback to receive the completed input line (required).- Parameters:
requestHandler- the request handler- Returns:
- this builder
-
completions
Sets the list of completions for tab completion.- Parameters:
completions- the completions list- Returns:
- this builder
-
preProcessors
Sets the list of input pre-processors.- Parameters:
preProcessors- the pre-processors list- Returns:
- this builder
-
history
Sets the history instance to use for this readline operation.- Parameters:
history- the history instance- Returns:
- this builder
-
cursorListener
Sets the cursor listener to receive cursor movement events.- Parameters:
cursorListener- the cursor listener- Returns:
- this builder
-
flags
Sets the readline flags controlling behavior.- Parameters:
flags- the flags map- Returns:
- this builder
-
build
Builds a newReadlineRequestfrom this builder's configuration.- Returns:
- a new ReadlineRequest instance
- Throws:
NullPointerException- if connection, prompt, or requestHandler is null
-