Class StringArgumentType

java.lang.Object
net.sourceforge.argparse4j.impl.type.StringArgumentType
All Implemented Interfaces:
ArgumentType<String>

public class StringArgumentType extends Object implements ArgumentType<String>
Specialized to String type, just echos back given string.
  • Constructor Details

    • StringArgumentType

      public StringArgumentType()
  • Method Details

    • convert

      public String convert(ArgumentParser parser, Argument arg, String value)
      Description copied from interface: ArgumentType

      Converts value to appropriate type.

      If the objects derived from RuntimeException are thrown in conversion because of invalid input from command line, subclass must catch these exceptions and wrap them in ArgumentParserException and give simple error message to explain what happened briefly.

      Specified by:
      convert in interface ArgumentType<String>
      Parameters:
      parser - The parser.
      arg - The argument this type attached to.
      value - The attribute value.
      Returns:
      Converted object.