Here you can find the source of toBool(String val, boolean def)
public static boolean toBool(String val, boolean def)
//package com.java2s; public class Main { public static boolean toBool(String val, boolean def) { if (val == null) { return def; }/* w ww .j a v a2 s .c om*/ if (val.equalsIgnoreCase("Y") || val.equalsIgnoreCase("T")) { return true; } else if (val.equalsIgnoreCase("N") || val.equalsIgnoreCase("F")) { return false; } else { return def; } } }