src/main/java/ognl/OgnlOps.java
public static boolean booleanValue(Object value)
    {
        if (value == null)
            return false;
        Class c = value.getClass();

        if (c == Boolean.class)
            return ((Boolean) value).booleanValue();

        if ( c == String.class )
            return Boolean.parseBoolean(String.valueOf(value));

        if (c == Character.class)
            return ((Character) value).charValue() != 0;
        if (value instanceof Number)
            return ((Number) value).doubleValue() != 0;
        
        return true; // non-null
    }
public static boolean booleanValue(Object value)
    {
        if (value == null)
            return false;
        Class c = value.getClass();

        if (c == Boolean.class)
            return ((Boolean) value).booleanValue();

        if ( c == String.class )
            return Boolean.parseBoolean(String.valueOf(value));

        if (c == Character.class)
            return ((Character) value).charValue() != 0;
        if (value instanceof Number)
            return ((Number) value).doubleValue() != 0;
        
        return true; // non-null
    }
public static boolean booleanValue ( Object value ) { if ( value == null ) return false ; Class c = value . getClass ( ) ; if ( c == Boolean . class ) return ( ( Boolean ) value ) . booleanValue ( ) ; if ( c == String . class ) return Boolean . parseBoolean ( String . valueOf ( value ) ) ; if ( c == Character . class ) return ( ( Character ) value ) . charValue ( ) != 0 ; if ( value instanceof Number ) return ( ( Number ) value ) . doubleValue ( ) != 0 ; return true ; // non-null }
Evaluates the given object as a boolean: if it is a Boolean object, it's easy; if it's a
Number or a Character, returns true for non-zero objects; and otherwise returns true for
non-null objects.

@param value
an object to interpret as a boolean
@return the boolean value implied by the given object
Evaluates the given object as a boolean : if it is a Boolean object it s easy ; if it s a Number or a Character returns true for non - zero objects ; and otherwise returns true for non - null objects .