MCPcopy Create free account
hub / github.com/MCBans/MCBans / toString

Method toString

src/main/java/com/mcbans/plugin/org/json/JSONObject.java:1336–1356  ·  view source on GitHub ↗

Make a JSON text of this JSONObject. For compactness, no whitespace is added. If this would not result in a syntactically correct JSON text, then null will be returned instead. Warning: This method assumes that the data structure is acyclical. @return a printable, displayable, portable, transmi

()

Source from the content-addressed store, hash-verified

1334 * with <code>}</code>&nbsp;<small>(right brace)</small>.
1335 */
1336 @Override
1337 public String toString() {
1338 try {
1339 Iterator keys = keys();
1340 StringBuffer sb = new StringBuffer("{");
1341
1342 while (keys.hasNext()) {
1343 if (sb.length() > 1) {
1344 sb.append(',');
1345 }
1346 Object o = keys.next();
1347 sb.append(quote(o.toString()));
1348 sb.append(':');
1349 sb.append(valueToString(this.map.get(o)));
1350 }
1351 sb.append('}');
1352 return sb.toString();
1353 } catch (Exception e) {
1354 return null;
1355 }
1356 }
1357
1358
1359 /**

Callers 12

executeMethod · 0.95
executeMethod · 0.95
executeMethod · 0.95
JSONObjectMethod · 0.45
doubleToStringMethod · 0.45
getStringMethod · 0.45
numberToStringMethod · 0.45
optStringMethod · 0.45
quoteMethod · 0.45
valueToStringMethod · 0.45
wrapMethod · 0.45
writeMethod · 0.45

Calls 8

keysMethod · 0.95
lengthMethod · 0.95
quoteMethod · 0.95
valueToStringMethod · 0.95
sortedKeysMethod · 0.95
nextMethod · 0.80
appendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected