parseJSON

public static Map<String, Object> parseJSON(String responseBody)

Decodes a raw JSON response body into a generic String-keyed map, with the NoneableDouble/NoneableLong adapters registered so numeric-or-"None" fields decode correctly.

Return

the decoded JSON, as a map from each top-level key to its value

Parameters

responseBody

the raw JSON response body

Throws

if the response body is not well-formed JSON

if responseBody is null


public static U parseJSON<U>(String responseBody, Class<U> c)

Decodes a raw JSON response body directly into an instance of c, with the NoneableDouble/NoneableLong adapters registered so numeric-or-"None" fields decode correctly.

Return

the decoded object

Parameters

<U>

the type to decode the response body into

responseBody

the raw JSON response body

c

the class to decode the response body into

Throws

if the response body is not well-formed JSON

if responseBody is null