Java tutorial
//package com.java2s; public class Main { public static final boolean convertValueToBoolean(CharSequence value, boolean defaultValue) { boolean result = false; if (null == value) { return defaultValue; } if (value.equals("1") || value.equals("true") || value.equals("TRUE")) { result = true; } return result; } }