public class GenericInputReader<T> extends InputReader<T,GenericInputReader<T>>
InputReader.ErrorMessageProvider, InputReader.ParseResult<T>
Modifier and Type | Field and Description |
---|---|
protected Function<String,InputReader.ParseResult<T>> |
parser |
defaultValue, errorMessageProvider, inputMasking, inputTrimming, numberedPossibleValues, possibleValues, propertyName, textTerminalSupplier, valueFormatter
Constructor and Description |
---|
GenericInputReader(Supplier<TextTerminal> textTerminalSupplier,
Function<String,InputReader.ParseResult<T>> parser) |
Modifier and Type | Method and Description |
---|---|
InputReader.ParseResult<T> |
parse(String s)
Parses the input string
|
checkConfiguration, getDefaultErrorMessage, getDefaultErrorMessage, getErrorMessage, printPrompt, read, read, withDefaultValue, withErrorMessageProvider, withInputMasking, withInputTrimming, withNumberedPossibleValues, withPossibleValues, withPossibleValues, withPropertyName, withValueFormatter
protected final Function<String,InputReader.ParseResult<T>> parser
public GenericInputReader(Supplier<TextTerminal> textTerminalSupplier, Function<String,InputReader.ParseResult<T>> parser)
public InputReader.ParseResult<T> parse(String s)
InputReader
parse
in class InputReader<T,GenericInputReader<T>>
s
- the input stringInputReader.ParseResult
that holds the parsed value and/or the error messages, if errors occurred.