-
- All Known Subinterfaces:
CheckboxPrompt,ChoicePrompt,ConfirmPrompt,EditorPrompt,InputPrompt,KeyPressPrompt,ListPrompt,NumberPrompt,PasswordPrompt,SearchPrompt<T>,TextPrompt,TogglePrompt
- All Known Implementing Classes:
DefaultCheckboxPrompt,DefaultChoicePrompt,DefaultConfirmPrompt,DefaultEditorPrompt,DefaultInputPrompt,DefaultKeyPressPrompt,DefaultListPrompt,DefaultNumberPrompt,DefaultPasswordPrompt,DefaultPrompt,DefaultSearchPrompt,DefaultTextPrompt,DefaultTogglePrompt
public interface PromptInterface for all promptable elements in the Prompter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.function.Function<java.lang.String,java.lang.String>getFilter()Get the filter function that modifies the actual returned value.java.lang.StringgetMessage()Get the message to display to the user.java.lang.StringgetName()Get the name of this prompt.default java.util.function.Function<java.lang.String,java.lang.String>getTransformer()Get the transformer function that modifies how the answer is displayed after submission.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get the name of this prompt. The name is used as the key in the result map.- Returns:
- the name of this prompt
-
getMessage
java.lang.String getMessage()
Get the message to display to the user.- Returns:
- the message
-
getTransformer
default java.util.function.Function<java.lang.String,java.lang.String> getTransformer()
Get the 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 "***".- Returns:
- the transformer function, or null for default display
-
getFilter
default java.util.function.Function<java.lang.String,java.lang.String> getFilter()
Get the 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.- Returns:
- the filter function, or null for no filtering
-
-