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

Method toJSON

src/redempt/redlib/itemutils/ItemSerializer.java:95–103  ·  view source on GitHub ↗
(ConfigurationSerializable s, Class<?> clazz)

Source from the content-addressed store, hash-verified

93 }
94
95 public static JSONMap toJSON(ConfigurationSerializable s, Class<?> clazz) {
96 Map<String, Object> map = s.serialize();
97 JSONMap json = new JSONMap();
98 json.put("==", clazz.getName().replace(NMSHelper.getNMSVersion(), "%version%"));
99 map.forEach((k, v) -> {
100 json.put(k, serialize(v));
101 });
102 return json;
103 }
104
105 public static Object serialize(Object o) {
106 if (o instanceof ConfigurationSerializable) {

Callers 2

serializeMethod · 0.95
toStringMethod · 0.95

Calls 4

serializeMethod · 0.95
getNMSVersionMethod · 0.95
forEachMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected