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 { public static boolean toBoolean(Object value) { if ((value == null || value instanceof Number && (((Number) value).longValue()) == 0L || value instanceof String && (value.equals("") || ((String) value).equalsIgnoreCase("false") || ((String) value).equalsIgnoreCase("no") || ((String) value).equalsIgnoreCase("0")) || value instanceof Boolean && value.equals(false))) { return false; }/* www . j ava 2 s .com*/ return true; } }