Here you can find the source of toBoolean(Object value)
public static Boolean toBoolean(Object value)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w. j a va2s .c o m * Convert an Object to a Boolean. */ public static Boolean toBoolean(Object value) { if (value == null) return false; //return null; if (value instanceof Boolean) return (Boolean) value; if ("TRUE".equalsIgnoreCase(value.toString())) return Boolean.TRUE; if ("".equals(value.toString())) return false; //return null; return Boolean.FALSE; } }