Here you can find the source of toBoolean(String value, boolean _default)
public static boolean toBoolean(String value, boolean _default)
//package com.java2s; //License from project: Apache License public class Main { public static boolean toBoolean(String value, boolean _default) { if (value == null || value.length() == 0) return _default; return Boolean.valueOf(value); }//from ww w . jav a 2 s. c o m }