java.lang.Object
org.jline.prompt.impl.DefaultConfirmBuilder
- All Implemented Interfaces:
BaseBuilder<ConfirmBuilder>,ConfirmBuilder
Default implementation of ConfirmBuilder.
This is now the native implementation that doesn't depend on console-ui.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConfirmBuilder(PromptBuilder parent) Create a new DefaultConfirmBuilder with the given parent. -
Method Summary
Modifier and TypeMethodDescriptionAdd this prompt to the parent builder.defaultValue(boolean defaultValue) Set the default value.Set a filter function that modifies the actual returned value.Set the message to display to the user.Set the name of this prompt.transformer(Function<String, String> transformer) Set a transformer function that modifies how the answer is displayed after submission.
-
Constructor Details
-
DefaultConfirmBuilder
Create a new DefaultConfirmBuilder with the given parent.- Parameters:
parent- the parent builder
-
-
Method Details
-
name
Set the name of this prompt.- Specified by:
namein interfaceBaseBuilder<ConfirmBuilder>- Parameters:
name- the name- Returns:
- this builder
-
message
Set the message to display to the user.- Specified by:
messagein interfaceBaseBuilder<ConfirmBuilder>- Parameters:
message- the message- Returns:
- this builder
-
defaultValue
Set the default value.- Specified by:
defaultValuein interfaceConfirmBuilder- Parameters:
defaultValue- the default value- Returns:
- this builder
-
transformer
Description copied from interface:BaseBuilderSet a transformer function that modifies how the answer is displayed after submission. This does not change the actual returned value. For example, a password prompt might transform the answer to "***".- Specified by:
transformerin interfaceBaseBuilder<ConfirmBuilder>- Parameters:
transformer- the transformer function- Returns:
- this builder instance for method chaining
-
filter
Description copied from interface:BaseBuilderSet a filter function that modifies the actual returned value. This changes the value stored in the result map. For example, trimming whitespace or converting to lowercase.- Specified by:
filterin interfaceBaseBuilder<ConfirmBuilder>- Parameters:
filter- the filter function- Returns:
- this builder instance for method chaining
-
addPrompt
Add this prompt to the parent builder.- Specified by:
addPromptin interfaceBaseBuilder<ConfirmBuilder>- Returns:
- the parent
PromptBuilderfor continued prompt configuration - See Also:
-