public class EnumInputReader<T extends java.lang.Enum<T>> extends InputReader<T,EnumInputReader<T>>
InputReader.possibleValues
with the constants returned by the values() method.
By default, it uses a numbered list for displaying the possible values.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 |
---|
EnumInputReader(java.util.function.Supplier<TextTerminal<?>> textTerminalSupplier,
java.lang.Class<T> enumClass) |
Modifier and Type | Method and Description |
---|---|
protected InputReader.ParseResult<T> |
parse(java.lang.String s)
Parses the input string
|
EnumInputReader<T> |
withAllValues() |
EnumInputReader<T> |
withAllValuesInline() |
EnumInputReader<T> |
withAllValuesNumbered() |
checkConfiguration, 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 EnumInputReader(java.util.function.Supplier<TextTerminal<?>> textTerminalSupplier, java.lang.Class<T> enumClass)
public EnumInputReader<T> withAllValues()
public EnumInputReader<T> withAllValuesNumbered()
public EnumInputReader<T> withAllValuesInline()
protected InputReader.ParseResult<T> parse(java.lang.String s)
InputReader
parse
in class InputReader<T extends java.lang.Enum<T>,EnumInputReader<T extends java.lang.Enum<T>>>
s
- the input stringInputReader.ParseResult
that holds the parsed value and/or the error messages, if errors occurred.