Here you can find the source of toBoolean(String str)
public static Boolean toBoolean(String str)
//package com.java2s; //License from project: Apache License public class Main { public static Boolean toBoolean(String str) { try {/* ww w .j a va 2 s . c o m*/ return Boolean.parseBoolean(str); } catch (Throwable e) { return null; } } }