Searched refs:optBoolean (Results 1 – 5 of 5) sorted by relevance
/libcore/json/src/test/java/libcore/org/json/ |
D | SelfUseTest.java | 60 @Override public boolean optBoolean(String key, boolean defaultValue) { 62 return super.optBoolean(key, defaultValue); 95 @Override public boolean optBoolean(int index, boolean fallback) { 97 return super.optBoolean(index, fallback); 146 object.optBoolean("foo"); in testObjectOptType() 193 array.optBoolean(3); in testArrayOptType()
|
D | JSONObjectTest.java | 99 assertEquals(false, object.optBoolean("foo")); in testEmptyObject() 100 assertEquals(true, object.optBoolean("foo", true)); in testEmptyObject() 234 assertEquals(true, object.optBoolean("foo")); in testBooleans() 235 assertEquals(false, object.optBoolean("bar")); in testBooleans() 236 assertEquals(true, object.optBoolean("baz")); in testBooleans() 237 assertEquals(false, object.optBoolean("quux")); in testBooleans() 238 assertEquals(false, object.optBoolean("missing")); in testBooleans() 239 assertEquals(true, object.optBoolean("foo", true)); in testBooleans() 240 assertEquals(false, object.optBoolean("bar", true)); in testBooleans() 241 assertEquals(true, object.optBoolean("baz", true)); in testBooleans() [all …]
|
D | JSONArrayTest.java | 56 assertFalse(array.optBoolean(0)); in testEmptyArray() 57 assertTrue(array.optBoolean(0, true)); in testEmptyArray() 98 assertEquals(true, array.optBoolean(0)); in testBooleans() 99 assertEquals(false, array.optBoolean(1, true)); in testBooleans() 100 assertEquals(true, array.optBoolean(2, false)); in testBooleans() 101 assertEquals(false, array.optBoolean(3)); in testBooleans() 125 assertEquals(false, other.optBoolean(1, true)); in testBooleans() 126 assertEquals(true, other.optBoolean(2)); in testBooleans() 139 assertEquals(false, array.optBoolean(0)); in testCoerceStringToBoolean() 140 assertEquals(true, array.optBoolean(0, true)); in testCoerceStringToBoolean() [all …]
|
/libcore/json/src/main/java/org/json/ |
D | JSONArray.java | 341 public boolean optBoolean(int index) { in optBoolean() method in JSONArray 342 return optBoolean(index, false); in optBoolean() 349 public boolean optBoolean(int index, boolean fallback) { in optBoolean() method in JSONArray
|
D | JSONObject.java | 433 public boolean optBoolean(@Nullable String name) { in optBoolean() method in JSONObject 434 return optBoolean(name, false); in optBoolean() 441 public boolean optBoolean(@Nullable String name, boolean fallback) { in optBoolean() method in JSONObject
|