Package liquibase.command.core.init
Class AbstractCommandLineValueGetter<T>
java.lang.Object
liquibase.command.core.init.AbstractCommandLineValueGetter<T>
- Type Parameters:
T
- the type the user is expected to enter
- Direct Known Subclasses:
DirectoryGetter
,EnumGetter
,FilenameGetter
,StringGetter
This class represents the basis for prompts to the user to input values, and should be used as part of the process
of obtaining user input for quality checks.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract T
Given the raw input string from the user, convert it to the right type.describe()
Describe the type of input expected by this class.final T
prompt
(InitProjectPromptingEnum parameter, Object currentValue) Prompt the user to enter a value for a parameter, and include the existing value in the prompt.abstract boolean
Given the input from the user, after being converted, validate it.
-
Field Details
-
NEW_PARAMETER_VALUES_SCOPE_KEY
- See Also:
-
-
Constructor Details
-
AbstractCommandLineValueGetter
Create a new value getter.- Parameters:
clazz
- the type of the value that will be obtained
-
-
Method Details
-
prompt
Prompt the user to enter a value for a parameter, and include the existing value in the prompt.- Parameters:
parameter
- the parameter to obtain a value fornewParameterValues
- a list of the values that have already been entered by the user during this interactive CLI parameter prompting situation- Returns:
- the value entered by the user
- Throws:
Exception
-
validate
Given the input from the user, after being converted, validate it.- Returns:
- true if it is valid
-
convert
Given the raw input string from the user, convert it to the right type.- Parameters:
input
- the raw input string from the prompt- Returns:
- the converted input
-
describe
Describe the type of input expected by this class.
-