NoneableLongAdapter

public class NoneableLongAdapter

Moshi (de)serialization adapter for Long fields annotated NoneableLong, registered on every Moshi.BuilderParser constructs.

fromJson parses Alpha Vantage's numeric-or-"None" string convention; toJson is unimplemented, since this library only reads Alpha Vantage responses and never serializes a Noneable-typed field back to JSON.

Author

Sylvester Sefa-Yeboah

Since

1.7.0

Constructors

Link copied to clipboard
public void NoneableLongAdapter()

Functions

Link copied to clipboard
public Long fromJson(String s)
Parses a JSON string field into a Long, per Alpha Vantage's numeric-or-"None" convention: a valid numeric string becomes its Long value, and any other string — including the literal "None" Alpha Vantage sends for an unavailable field — becomes null.
Link copied to clipboard
public Long toJson(Long l)
Always throws.