RealtimeBulkQuoteParser

Turns a decoded REALTIME_BULK_QUOTES payload into a RealtimeBulkQuoteResponse.

The snapshots sit under the payload's third top-level key, after the endpoint name and a status message, and the parser reaches for that position rather than matching the key by name. An error payload has no third key, so failing to find one is itself the signal to fall back to reading the first key's value as a message.

Functions

Link copied to clipboard
public static N getNumberFromString<N extends Number>(String s, Function<String, N> parser)
Link copied to clipboard
Wraps a parse failure or an API error message in a response.
Link copied to clipboard
Reads the snapshot array into a response.
Link copied to clipboard
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.
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.
Link copied to clipboard
public static List<U> parseJSONList<U>(Object object, Class<U> klass)
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
public static String toJSON(Map<String, Object> data)
Encodes a String-keyed map back into a JSON string, with the NoneableDouble/NoneableLong adapters registered.