Home
last modified time | relevance | path

Searched refs:optString (Results 1 – 5 of 5) sorted by relevance

/libcore/json/src/test/java/libcore/org/json/
DSelfUseTest.java76 @Override public String optString(String key, String defaultValue) {
78 return super.optString(key, defaultValue);
107 @Override public String optString(int index, String fallback) {
109 return super.optString(index, fallback);
158 object.optString("foo"); in testObjectOptType()
205 array.optString(3); in testArrayOptType()
DJSONArrayTest.java104 assertEquals("true", array.optString(2)); in testBooleans()
105 assertEquals("false", array.optString(3, "x")); in testBooleans()
175 assertEquals("null", array.optString(0)); in testNulls()
176 assertEquals("", array.optString(1)); in testNulls()
177 assertEquals("", array.optString(2)); in testNulls()
178 assertEquals("", array.optString(3)); in testNulls()
270 assertEquals("5.5", array.optString(1)); in testStrings()
271 assertEquals("9223372036854775806", array.optString(2, null)); in testStrings()
272 assertEquals("null", array.optString(3, "-1")); in testStrings()
524 assertEquals("", array.optString(3)); in testAccessOutOfBounds()
[all …]
DJSONObjectTest.java109 assertEquals("", object.optString("foo")); // empty string is default! in testEmptyObject()
110 assertEquals("bar", object.optString("foo", "bar")); in testEmptyObject()
424 assertEquals("5.5", object.optString("bar")); in testStrings()
425 assertEquals("true", object.optString("foo", "x")); in testStrings()
858 assertEquals("", object.optString(null)); in testOptNull()
863 assertEquals("baz", object.optString(null, "baz")); in testOptNull()
/libcore/json/src/main/java/org/json/
DJSONArray.java476 public String optString(int index) { in optString() method in JSONArray
477 return optString(index, ""); in optString()
484 public String optString(int index, String fallback) { in optString() method in JSONArray
DJSONObject.java573 @NonNull public String optString(@Nullable String name) { in optString() method in JSONObject
574 return optString(name, ""); in optString()
581 @NonNull public String optString(@Nullable String name, @NonNull String fallback) { in optString() method in JSONObject