public class StringInputReader extends InputReader<String,StringInputReader>
InputReader.ErrorMessagesProvider, InputReader.ParseResult<T>, InputReader.ValueChecker<T>
defaultValue, equalsFunc, inputMasking, inputTrimming, numberedPossibleValues, parseErrorMessagesProvider, possibleValues, promptAdjustments, propertyName, textTerminalSupplier, valueCheckers, valueFormatter, valueListCheckers
Constructor and Description |
---|
StringInputReader(Supplier<TextTerminal> textTerminalSupplier) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkConfiguration()
In addition to the checks performed by
InputReader.checkConfiguration() , it checks if minVal <= maxVal |
protected List<String> |
getLengthValidationErrors(String s) |
protected List<String> |
getPatternValidationErrors(String s) |
protected InputReader.ParseResult<String> |
parse(String s)
Parses the input string
|
StringInputReader |
withMaxLength(int maxLength) |
StringInputReader |
withMinLength(int minLength) |
StringInputReader |
withPattern(String regex) |
StringInputReader |
withPattern(String regex,
int flags) |
getDefaultErrorMessage, getDefaultErrorMessages, getErrorMessages, isPossibleValue, isValueListMode, noDuplicatesChecker, nonEmptyListChecker, parseAndCheck, printPrompt, read, read, readList, readList, withDefaultValue, withEqualsFunc, withInputMasking, withInputTrimming, withNumberedPossibleValues, withParseErrorMessagesProvider, withPossibleValues, withPossibleValues, withPromptAdjustments, withPropertyName, withValueChecker, withValueFormatter, withValueListChecker
public StringInputReader(Supplier<TextTerminal> textTerminalSupplier)
public StringInputReader withPattern(String regex)
public StringInputReader withPattern(String regex, int flags)
public StringInputReader withMinLength(int minLength)
public StringInputReader withMaxLength(int maxLength)
protected InputReader.ParseResult<String> parse(String s)
InputReader
parse
in class InputReader<String,StringInputReader>
s
- the input stringInputReader.ParseResult
that holds the parsed value and/or the error messages, if errors occurred.protected void checkConfiguration() throws IllegalArgumentException
InputReader.checkConfiguration()
, it checks if minVal <= maxValcheckConfiguration
in class InputReader<String,StringInputReader>
IllegalArgumentException