Class EnumArgumentType<T extends Enum<T>>

java.lang.Object
net.sourceforge.argparse4j.impl.type.EnumArgumentType<T>
Type Parameters:
T - Type of enum
All Implemented Interfaces:
ArgumentType<T>

@Deprecated public class EnumArgumentType<T extends Enum<T>> extends Object implements ArgumentType<T>
Deprecated.
Use ReflectArgumentType instead.

ArgumentType subclass for enum type.

Since enum does not have a constructor with string argument, it cannot be used with Argument.type(Class). Instead use this class to specify enum type. The enums in its nature have limited number of members. In convert(ArgumentParser, Argument, String), String value will be converted to one of them. If it cannot be converted, convert(ArgumentParser, Argument, String) will throw ArgumentParserException. This means it already act like a Argument.choices(Object...).

  • Field Details

    • type_

      private final Class<T extends Enum<T>> type_
      Deprecated.
  • Constructor Details

    • EnumArgumentType

      public EnumArgumentType(Class<T> type)
      Deprecated.
  • Method Details