public final class Moshi extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Moshi.Builder |
Modifier and Type | Method and Description |
---|---|
<T> JsonAdapter<T> |
adapter(Class<T> type) |
<T> JsonAdapter<T> |
adapter(Type type)
Returns a JSON adapter for
type , creating it if necessary. |
<T> JsonAdapter<T> |
adapter(Type type,
Class<? extends Annotation>... annotationTypes) |
<T> JsonAdapter<T> |
adapter(Type type,
Class<? extends Annotation> annotationType) |
<T> JsonAdapter<T> |
adapter(Type type,
Set<? extends Annotation> annotations) |
<T> JsonAdapter<T> |
adapter(Type type,
Set<? extends Annotation> annotations,
String fieldName) |
Moshi.Builder |
newBuilder()
Returns a new builder containing all custom factories used by the current instance.
|
<T> JsonAdapter<T> |
nextAdapter(JsonAdapter.Factory skipPast,
Type type,
Set<? extends Annotation> annotations) |
@CheckReturnValue public <T> JsonAdapter<T> adapter(Type type)
type
, creating it if necessary.@CheckReturnValue public <T> JsonAdapter<T> adapter(Class<T> type)
@CheckReturnValue public <T> JsonAdapter<T> adapter(Type type, Class<? extends Annotation> annotationType)
@CheckReturnValue public <T> JsonAdapter<T> adapter(Type type, Class<? extends Annotation>... annotationTypes)
@CheckReturnValue public <T> JsonAdapter<T> adapter(Type type, Set<? extends Annotation> annotations)
@CheckReturnValue public <T> JsonAdapter<T> adapter(Type type, Set<? extends Annotation> annotations, @Nullable String fieldName)
fieldName
- An optional field name associated with this type. The field name is used as a
hint for better adapter lookup error messages for nested structures.@CheckReturnValue public <T> JsonAdapter<T> nextAdapter(JsonAdapter.Factory skipPast, Type type, Set<? extends Annotation> annotations)
@CheckReturnValue public Moshi.Builder newBuilder()
Copyright © 2018. All rights reserved.