StandardJsonAdapters

class StandardJsonAdapters

Types

EnumJsonAdapter
Link copied to clipboard
class EnumJsonAdapter<T : Enum<T>?> : JsonAdapter<T>
ObjectJsonAdapter
Link copied to clipboard

This adapter is used when the declared type is {@code java.lang.Object} . Typically the runtime type is something else, and when encoding JSON this delegates to the runtime type's adapter. For decoding (where there is no runtime type to inspect), this uses maps and lists.

This adapter needs a Moshi instance to look up the appropriate adapter for runtime types as they are encountered.

class ObjectJsonAdapter : JsonAdapter<Any>

Functions

rangeCheckNextInt
Link copied to clipboard
open fun rangeCheckNextInt(reader: JsonReader, typeMessage: String, min: Int, max: Int): Int

Properties

BOOLEAN_JSON_ADAPTER
Link copied to clipboard
val BOOLEAN_JSON_ADAPTER: JsonAdapter<Boolean>
BYTE_JSON_ADAPTER
Link copied to clipboard
val BYTE_JSON_ADAPTER: JsonAdapter<Byte>
CHARACTER_JSON_ADAPTER
Link copied to clipboard
val CHARACTER_JSON_ADAPTER: JsonAdapter<Character>
DOUBLE_JSON_ADAPTER
Link copied to clipboard
val DOUBLE_JSON_ADAPTER: JsonAdapter<Double>
FACTORY
Link copied to clipboard
val FACTORY: JsonAdapter.Factory
FLOAT_JSON_ADAPTER
Link copied to clipboard
val FLOAT_JSON_ADAPTER: JsonAdapter<Float>
INTEGER_JSON_ADAPTER
Link copied to clipboard
val INTEGER_JSON_ADAPTER: JsonAdapter<Integer>
LONG_JSON_ADAPTER
Link copied to clipboard
val LONG_JSON_ADAPTER: JsonAdapter<Long>
SHORT_JSON_ADAPTER
Link copied to clipboard
val SHORT_JSON_ADAPTER: JsonAdapter<Short>
STRING_JSON_ADAPTER
Link copied to clipboard
val STRING_JSON_ADAPTER: JsonAdapter<String>