com.twitter.common.args.parsers
Class RangeParser

java.lang.Object
  extended by com.twitter.common.args.parsers.NonParameterizedTypeParser<Range<Integer>>
      extended by com.twitter.common.args.parsers.RangeParser

A parser that handles closed ranges. For the input "4-6", it will capture [4, 5, 6].


Constructor Summary
RangeParser()
          
Method Summary
 Range<Integer> doParse(String raw)
          
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

RangeParser

public RangeParser()
Method Detail

doParse

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

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