Package org.apache.maven.api.services
Interface Prompter
- All Superinterfaces:
Service
Service used to interact with the end user.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Prompts the user for a string.default String
Prompts the user for a string using a default value.default String
Prompts the user for a string using a list of possible values.Prompts the user for a string using a list of possible values and a default reply.promptForPassword
(String message) Prompts the user for a password.void
showMessage
(String message) Displays a message to the user.
-
Method Details
-
prompt
Prompts the user for a string.- Parameters:
message
- the message to display to the user- Returns:
- the string entered by the user
- Throws:
PrompterException
- if an exception occurs
-
prompt
@Nonnull default String prompt(@Nullable String message, @Nullable String defaultReply) throws PrompterException Prompts the user for a string using a default value.- Parameters:
message
- the message to displaydefaultReply
- the default reply value- Returns:
- the string entered by the user
- Throws:
PrompterException
- if an exception occurs
-
prompt
@Nonnull default String prompt(@Nullable String message, @Nullable List<String> possibleValues) throws PrompterException Prompts the user for a string using a list of possible values.- Parameters:
message
- the message to displaypossibleValues
- the list of possible values- Returns:
- the string entered by the user
- Throws:
PrompterException
- if an exception occurs
-
prompt
@Nonnull String prompt(@Nullable String message, @Nullable List<String> possibleValues, @Nullable String defaultReply) throws PrompterException Prompts the user for a string using a list of possible values and a default reply.- Parameters:
message
- the message to displaypossibleValues
- the list of possible valuesdefaultReply
- the default reply value- Returns:
- the string entered by the user
- Throws:
PrompterException
- if an exception occurs
-
promptForPassword
Prompts the user for a password.- Parameters:
message
- the message to display- Returns:
- the password entered by the user
- Throws:
PrompterException
- if an exception occurs
-
showMessage
Displays a message to the user.- Parameters:
message
- the message to display- Throws:
PrompterException
- if an exception occurs
-