Class StringArgumentType

  • All Implemented Interfaces:
    ArgumentType<java.lang.String>

    public class StringArgumentType
    extends java.lang.Object
    implements ArgumentType<java.lang.String>
    Specialized to String type, just echos back given string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String convert​(ArgumentParser parser, Argument arg, java.lang.String value)
      Converts value to appropriate type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringArgumentType

        public StringArgumentType()
    • Method Detail

      • convert

        public java.lang.String convert​(ArgumentParser parser,
                                        Argument arg,
                                        java.lang.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<java.lang.String>
        Parameters:
        parser - The parser.
        arg - The argument this type attached to.
        value - The attribute value.
        Returns:
        Converted object.