Here you can find the source of toBoolean(final String val)
private static Object toBoolean(final String val)
//package com.java2s; //License from project: Open Source License public class Main { private static Object toBoolean(final String val) { if (val.equalsIgnoreCase("on")) { return Boolean.TRUE; } else if (val.equalsIgnoreCase("off")) { return Boolean.FALSE; }//from www. ja v a 2 s .co m return Boolean.parseBoolean(val); } }