Exchange Rate Parser
Turns a decoded CURRENCY_EXCHANGE_RATE payload into an ExchangeRateResponse.
The quote sits under the payload's single top-level key, which the parser reaches for by position rather than by name. An error payload carries a plain message string at that position instead of a nested object, so the failed cast is itself the signal to read the value as an error message.
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.