Here you can find the source of booleanValue(Object value)
public static boolean booleanValue(Object value)
//package com.java2s; //License from project: Apache License public class Main { /**/* ww w . j av a2 s. com*/ * Convert an Object to a Boolean. */ public static boolean booleanValue(Object value) { if (value == null) return false; if (value instanceof Boolean) return ((Boolean) value).booleanValue(); if (value instanceof Number) return ((Number) value).intValue() != 0; return "TRUE".equalsIgnoreCase(value.toString()); } /** * Convert an Object to an int, or 0 if it is null. */ public static int intValue(Object value) { if (value == null) return 0; return toInteger(value).intValue(); } /** * Convert an Object to an Integer. */ public static Integer toInteger(Object value) { if (value == null) return null; if (value instanceof Integer) return (Integer) value; if (value instanceof String) { if ("".equals((String) value)) return null; return new Integer((String) value); } if (value instanceof Number) return new Integer(((Number) value).intValue()); return new Integer(value.toString()); } }