Moshi

class Moshi

Coordinates binding between JSON values and Java objects.

Moshi instances are thread-safe, meaning multiple threads can safely use a single instance concurrently.

Types

Link copied to clipboard
class Builder

Functions

Link copied to clipboard
open fun <T> adapter(type: Class<T>): JsonAdapter<T>
open fun <T> adapter(type: Type, annotationTypes: Array<Class<out Annotation>>): JsonAdapter<T>
open fun <T> adapter(type: Type, annotationType: Class<out Annotation>): JsonAdapter<T>
open fun <T> adapter(type: Type, annotations: Set<out Annotation>): JsonAdapter<T>
open fun <T> adapter(    type: Type,     annotations: Set<out Annotation>,     @Nullable fieldName: String): JsonAdapter<T>

open fun <T> adapter(type: Type): JsonAdapter<T>
Returns a JSON adapter for type, creating it if necessary.
Link copied to clipboard
open fun newBuilder(): Moshi.Builder
Returns a new builder containing all custom factories used by the current instance.
Link copied to clipboard
open fun <T> nextAdapter(    skipPast: JsonAdapter.Factory,     type: Type,     annotations: Set<out Annotation>): JsonAdapter<T>

Extensions

Link copied to clipboard
inline fun <T> Moshi.adapter(): JsonAdapter<T>
fun <T> Moshi.adapter(ktype: KType): JsonAdapter<T>