com.twitter.common.args.parsers
Class NumberParser<T extends Number>

java.lang.Object
  extended by com.twitter.common.args.parsers.NonParameterizedTypeParser<T>
      extended by com.twitter.common.args.parsers.NumberParser<T>
Direct Known Subclasses:
ByteParser, DoubleParser, FloatParser, IntegerParser, LongParser, ShortParser

public abstract class NumberParser<T extends Number>
extends NonParameterizedTypeParser<T>

Parser that handles common functionality for parsing numbers.


Constructor Summary
NumberParser()
           
 
Method Summary
 T doParse(String raw)
          Performs the parsing of the raw string.
 
Methods inherited from class com.twitter.common.args.parsers.NonParameterizedTypeParser
parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberParser

public NumberParser()
Method Detail

doParse

public T doParse(String raw)
                         throws IllegalArgumentException
Description copied from class: NonParameterizedTypeParser
Performs the parsing of the raw string.

Specified by:
doParse in class NonParameterizedTypeParser<T extends Number>
Parameters:
raw - Value to parse.
Returns:
The parsed value.
Throws:
IllegalArgumentException - If the value could not be parsed into the target type.