public static Boolean toBooleanOrNull(String stringValue) {if (stringValue == null)return null;if (equalsIgnoreCase("yes", stringValue) || equalsIgnoreCase("true", stringValue) || equalsIgnoreCase("1", stringValue) || equalsIgnoreCase("on", stringValue)) return Boolean.TRUE;else if (equalsIgnoreCase("no", stringValue) || equalsIgnoreCase("false", stringValue) || equalsIgnoreCase("0", stringValue) || equalsIgnoreCase("off", stringValue)) return Boolean.FALSE;else return null;}
public static bool? ToBooleanOrNull(string stringValue){if (stringValue == null){return null;}if (EqualsIgnoreCase("yes", stringValue) || EqualsIgnoreCase("true", stringValue)|| EqualsIgnoreCase("1", stringValue) || EqualsIgnoreCase("on", stringValue)){return true;}else{if (EqualsIgnoreCase("no", stringValue) || EqualsIgnoreCase("false", stringValue)|| EqualsIgnoreCase("0", stringValue) || EqualsIgnoreCase("off", stringValue)){return false;}else{return null;}}}