MCPcopy
hub / github.com/google/gson / toJson

Method toJson

src/main/java/com/google/gson/Gson.java:236–241  ·  view source on GitHub ↗

This method serializes the specified object into its equivalent Json representation. This method should be used when the specified object is not a generic type. This method uses Class#getClass() to get the type for the specified object, but the getClass() loses the generic type infor

(Object src)

Source from the content-addressed store, hash-verified

234 * @return Json representation of {@code src}.
235 */
236 public String toJson(Object src) {
237 if (src == null) {
238 return toJson(JsonNull.createJsonNull());
239 }
240 return toJson(src, src.getClass());
241 }
242
243 /**
244 * This method serializes the specified object, including those of generic types, into its

Calls 11

createJsonNullMethod · 0.95
toJsonTreeMethod · 0.95
writerForAppendableMethod · 0.95
setIndentMethod · 0.95
writeMethod · 0.95
appendMethod · 0.80
isHtmlSafeMethod · 0.80
setHtmlSafeMethod · 0.80
toStringMethod · 0.45
isLenientMethod · 0.45
setLenientMethod · 0.45