Here you can find the source of toBoolean(String value)
public static Boolean toBoolean(String value)
//package com.java2s; //License from project: Open Source License public class Main { public static Boolean toBoolean(String value) { if (null == value) { return null; }//from w w w. j av a 2 s . co m String str = value.trim(); if ("null".equals(str)) { return null; } if ("1".equals(str)) { return true; } if ("0".equals(str)) { return false; } return Boolean.parseBoolean(str); } public static Boolean toBoolean(Object value) { if (null == value) { return null; } return toBoolean(String.valueOf(value)); } }