Package com.squareup.moshi

Moshi is modern JSON library for Android and Java.

Types

FromJson
Link copied to clipboard
annotation class FromJson
Json
Link copied to clipboard
@Retention(value = )
annotation class Json
Customizes how a field is encoded as JSON.
JsonAdapter
Link copied to clipboard
abstract class JsonAdapter<T>
Converts Java values to JSON, and JSON values to Java.
JsonClass
Link copied to clipboard
@Retention(value = )
annotation class JsonClass
Customizes how a type is encoded as JSON.
JsonDataException
Link copied to clipboard
class JsonDataException : RuntimeException
Thrown when the data in a JSON document doesn't match the data expected by the caller.
JsonEncodingException
Link copied to clipboard
class JsonEncodingException : IOException
Thrown when the data being parsed is not encoded as valid JSON.
JsonQualifier
Link copied to clipboard
@Target(value = )
@Retention(value = )
annotation class JsonQualifier
Annotates another annotation, causing it to specialize how values are encoded and decoded.
JsonReader
Link copied to clipboard
abstract class JsonReader : Closeable
Reads a JSON (RFC 7159) encoded value as a stream of tokens.
JsonWriter
Link copied to clipboard
abstract class JsonWriter : Closeable, Flushable
Writes a JSON (RFC 7159) encoded value to a stream, one token at a time.
Moshi
Link copied to clipboard
class Moshi
Coordinates binding between JSON values and Java objects.
ToJson
Link copied to clipboard
annotation class ToJson
Types
Link copied to clipboard
class Types
Factory methods for types.

Functions

adapter
Link copied to clipboard
inline fun <T> Moshi.adapter(): JsonAdapter<T>
fun <T> Moshi.adapter(ktype: KType): JsonAdapter<T>
addAdapter
Link copied to clipboard
inline fun <T> Moshi.Builder.addAdapter(adapter: JsonAdapter<T>): Moshi.Builder
asArrayType
Link copied to clipboard
fun Type.asArrayType(): GenericArrayType
fun KClass<*>.asArrayType(): GenericArrayType
nextAnnotations
Link copied to clipboard
inline fun <T : Annotation> Set<Annotation>.nextAnnotations(): Set<Annotation>?
Checks if this contains T.
subtypeOf
Link copied to clipboard
inline fun <T> subtypeOf(): WildcardType
Returns a type that represents an unknown type that extends T.
supertypeOf
Link copied to clipboard
inline fun <T> supertypeOf(): WildcardType
Returns a type that represents an unknown supertype of T bound.

Properties

rawType
Link copied to clipboard
val Type.rawType: Class<*>
Returns the raw Class type of this type.