MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / toBooleanValue

Method toBooleanValue

CodenameOne/src/com/codename1/io/Util.java:2395–2407  ·  view source on GitHub ↗
(Object val)

Source from the content-addressed store, hash-verified

2393 ///
2394 /// true or false
2395 public static boolean toBooleanValue(Object val) {
2396 if (val == null) {
2397 return false;
2398 }
2399 if (val instanceof Boolean) {
2400 return ((Boolean) val).booleanValue();
2401 }
2402 if (val instanceof String) {
2403 String sl = ((String) val).toLowerCase();
2404 return sl.startsWith("t") || "1".equals(sl);
2405 }
2406 return toIntValue(val) != 0;
2407 }
2408
2409 /// Returns the number object as an int
2410 ///

Callers 4

setSimpleObjectMethod · 0.95
asUpdateInsertValueMethod · 0.95
createCellMethod · 0.95
invokeStatic16Method · 0.80

Calls 5

startsWithMethod · 0.95
toIntValueMethod · 0.95
booleanValueMethod · 0.65
toLowerCaseMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected