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

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

public class ConverterToBoolean
extends Object

Converter of any Object to Boolean.


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

Constructor Detail

ConverterToBoolean

public ConverterToBoolean()
Method Detail

convert

public static Boolean convert(Object o)
                       throws IllegalArgumentException
Converts an Object to Boolean value.

Keeps null as null. Converts 0, false and no to boolean false. Converts 1, true and yes to boolean true.

Parameters:
o - Object to be converted
Returns:
Boolean
Throws:
IllegalArgumentException - Thrown when the argument cannot be converted to Boolean


Copyright © 2008-2011 SEAF. All Rights Reserved.