net.sf.seaf.util.convert.simple
Class ConverterToInteger
java.lang.Object
net.sf.seaf.util.convert.simple.ConverterToInteger
public class ConverterToInteger
- extends Object
Converter of any Object to Integer.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConverterToInteger
public ConverterToInteger()
convert
public static Integer convert(Object o)
throws NumberFormatException
- Converts an Object to Integer value.
Keeps null as null. Floating point number is cut to its intValue().
Boolean is converted to 1 or 0. Throws NumberFormatException if cannot be
parsed.
- Parameters:
o - Object to be converted
- Returns:
- Integer
- Throws:
NumberFormatException - Thrown when the argument cannot be converted to Integer
Copyright © 2008-2011 SEAF. All Rights Reserved.