net.sf.seaf.util.convert.simple
Class ConverterToLong

java.lang.Object
  extended by net.sf.seaf.util.convert.simple.ConverterToLong

public class ConverterToLong
extends Object

Converter of any Object to Long.


Constructor Summary
ConverterToLong()
           
 
Method Summary
static Long convert(Object o)
          Converts an Object to Long value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterToLong

public ConverterToLong()
Method Detail

convert

public static Long convert(Object o)
                    throws NumberFormatException
Converts an Object to Long value.

Keeps null as null. Floating point number is cut to its longValue(). Boolean is converted to 1 or 0. Throws NumberFormatException if cannot be parsed.

Parameters:
o - Object to be converted
Returns:
Long
Throws:
NumberFormatException - Thrown when the argument cannot be converted to Long


Copyright © 2008-2011 SEAF. All Rights Reserved.