public class StringInputReader extends InputReader<java.lang.String,StringInputReader>
InputReader.ErrorMessagesProvider, InputReader.ParseResult<T>, InputReader.ValueChecker<T>
defaultValue, equalsFunc, inlinePossibleValues, inputMasking, inputTrimming, itemName, numberedPossibleValues, parseErrorMessagesProvider, possibleValues, promptAdjustments, propertiesConfigurator, textTerminalSupplier, valueCheckers, valueFormatter, valueListCheckers
Constructor and Description |
---|
StringInputReader(java.util.function.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 java.util.List<java.lang.String> |
getLengthValidationErrors(java.lang.String s) |
protected java.util.List<java.lang.String> |
getPatternValidationErrors(java.lang.String s) |
protected InputReader.ParseResult<java.lang.String> |
parse(java.lang.String s)
Parses the input string
|
StringInputReader |
withIgnoreCase() |
StringInputReader |
withMaxLength(int maxLength) |
StringInputReader |
withMinLength(int minLength) |
StringInputReader |
withPattern(java.lang.String regex) |
StringInputReader |
withPattern(java.lang.String regex,
int flags) |
executeWithTerminal, getDefaultErrorMessage, getDefaultErrorMessages, getErrorMessages, getPossibleValue, isPossibleValue, isValueListMode, noDuplicatesChecker, nonEmptyListChecker, parseAndCheck, printPrompt, read, read, readList, readList, readWithPrompt, withDefaultValue, withEqualsFunc, withInlinePossibleValues, withInlinePossibleValues, withInputMasking, withInputTrimming, withItemName, withNumberedPossibleValues, withNumberedPossibleValues, withParseErrorMessagesProvider, withPossibleValues, withPossibleValues, withPromptAdjustments, withPropertiesConfigurator, withValueChecker, withValueFormatter, withValueListChecker
public StringInputReader(java.util.function.Supplier<TextTerminal<?>> textTerminalSupplier)
public StringInputReader withPattern(java.lang.String regex)
public StringInputReader withPattern(java.lang.String regex, int flags)
public StringInputReader withMinLength(int minLength)
public StringInputReader withMaxLength(int maxLength)
public StringInputReader withIgnoreCase()
protected InputReader.ParseResult<java.lang.String> parse(java.lang.String s)
InputReader
parse
in class InputReader<java.lang.String,StringInputReader>
s
- the input stringInputReader.ParseResult
that holds the parsed value and/or the error messages, if errors occurred.protected void checkConfiguration() throws java.lang.IllegalArgumentException
InputReader.checkConfiguration()
, it checks if minVal <= maxValcheckConfiguration
in class InputReader<java.lang.String,StringInputReader>
java.lang.IllegalArgumentException
protected java.util.List<java.lang.String> getLengthValidationErrors(java.lang.String s)
protected java.util.List<java.lang.String> getPatternValidationErrors(java.lang.String s)