Here you can find the source of castBoolean(Object o)
public static Boolean castBoolean(Object o)
//package com.java2s; //License from project: Open Source License public class Main { public static Boolean castBoolean(Object o) { if (o == null) { return false; } else if (o instanceof Boolean) { return (Boolean) o; } else if (o instanceof String) { return ((String) o).equalsIgnoreCase("true") ? true : false; } else {//from w w w. j a v a 2 s . c om return false; } } }