MCPcopy Create free account
hub / github.com/boxbeam/RedLib / toJSONString

Method toJSONString

src/redempt/redlib/json/JSONParser.java:14–22  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

12 }
13
14 public static String toJSONString(Object o) {
15 if (o instanceof String) {
16 return '"' + ((String) o).replace("\\", "\\\\").replace("\"", "\\\"") + '"';
17 }
18 if (o instanceof Long) {
19 return o + "L";
20 }
21 return o.toString();
22 }
23
24 public static JSONMap parseMap(String json) {
25 return new JSONParser(json).map();

Callers 2

toStringMethod · 0.95
toStringMethod · 0.95

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected