Quote Parser
Turns a decoded GLOBAL_QUOTE payload into a QuoteResponse.
The quote arrives nested one level down, under a single top-level key, and its own fields are numbered rather than named. The parser reads whatever the first top-level key holds rather than matching that key by name, so an error payload — whose one key holds a message string instead of an object — falls out as a ClassCastException and is turned into an error response.
Functions
Link copied to clipboard
Link copied to clipboard
Wraps a parse failure or an API error message in a response.
Link copied to clipboard
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.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.Link copied to clipboard
Converts an already-decoded JSON value, typically a
List produced by parseJSON, into a List of klass instances, with the NoneableDouble/NoneableLong adapters registered so numeric-or-"None" fields decode correctly.Link copied to clipboard
Encodes a
String-keyed map back into a JSON string, with the NoneableDouble/NoneableLong adapters registered.