Modifier and Type | Method and Description |
---|---|
<T> JsonAdapter<T> |
Moshi.adapter(Class<T> type) |
<T> JsonAdapter<T> |
Moshi.adapter(Type type)
Returns a JSON adapter for
type , creating it if necessary. |
<T> JsonAdapter<T> |
Moshi.adapter(Type type,
Class<? extends Annotation>... annotationTypes) |
<T> JsonAdapter<T> |
Moshi.adapter(Type type,
Class<? extends Annotation> annotationType) |
<T> JsonAdapter<T> |
Moshi.adapter(Type type,
Set<? extends Annotation> annotations) |
<T> JsonAdapter<T> |
Moshi.adapter(Type type,
Set<? extends Annotation> annotations,
String fieldName) |
JsonAdapter<?> |
JsonAdapter.Factory.create(Type type,
Set<? extends Annotation> annotations,
Moshi moshi)
Attempts to create an adapter for
type annotated with annotations . |
JsonAdapter<T> |
JsonAdapter.failOnUnknown()
Returns a JSON adapter equal to this, but that throws a
JsonDataException when
unknown names and values are encountered. |
JsonAdapter<T> |
JsonAdapter.indent(String indent)
Return a JSON adapter equal to this, but using
indent to control how the result is
formatted. |
JsonAdapter<T> |
JsonAdapter.lenient()
Returns a JSON adapter equal to this, but is lenient when reading and writing.
|
<T> JsonAdapter<T> |
Moshi.nextAdapter(JsonAdapter.Factory skipPast,
Type type,
Set<? extends Annotation> annotations) |
JsonAdapter<T> |
JsonAdapter.nonNull()
Returns a JSON adapter equal to this JSON adapter, but that refuses null values.
|
JsonAdapter<T> |
JsonAdapter.nullSafe()
Returns a JSON adapter equal to this JSON adapter, but with support for reading and writing
nulls.
|
JsonAdapter<T> |
JsonAdapter.serializeNulls()
Returns a JSON adapter equal to this JSON adapter, but that serializes nulls when encoding
JSON.
|
Modifier and Type | Method and Description |
---|---|
<T> Moshi.Builder |
Moshi.Builder.add(Type type,
Class<? extends Annotation> annotation,
JsonAdapter<T> jsonAdapter) |
<T> Moshi.Builder |
Moshi.Builder.add(Type type,
JsonAdapter<T> jsonAdapter) |
Copyright © 2018. All rights reserved.