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

Method fromJson

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

This method deserializes the specified Json into an object of the specified class. It is not suitable to use if the specified class is a generic type since it will not have the generic type information because of the Type Erasure feature of Java. Therefore, this method should not be used if the desi

(String json, Class<T> classOfT)

Source from the content-addressed store, hash-verified

386 * classOfT
387 */
388 public <T> T fromJson(String json, Class<T> classOfT) throws JsonSyntaxException {
389 Object object = fromJson(json, (Type) classOfT);
390 return Primitives.wrap(classOfT).cast(object);
391 }
392
393 /**
394 * This method deserializes the specified Json into an object of the specified type. This method

Calls 6

wrapMethod · 0.95
assertFullConsumptionMethod · 0.95
parseMethod · 0.95
deserializeMethod · 0.95
isLenientMethod · 0.45
setLenientMethod · 0.45