Here you can find the source of convertBoolean(String str)
public static boolean convertBoolean(String str)
//package com.java2s; public class Main { public static boolean convertBoolean(String str) { return convertBoolean(str, false); }/*from w w w.j av a 2 s . com*/ public static boolean convertBoolean(String value, boolean defaultValue) { if (value == null) return defaultValue; value = value.trim().toUpperCase(); return value.equals("1") || value.equals("TRUE") || value.equals("YES") || value.equals("T") || value.equals("Y"); } }