public final class MoshiConverterFactory extends Converter.Factory
Because Moshi is so flexible in the types it supports, this converter assumes that it can handle all types. If you are mixing JSON serialization with something else (such as protocol buffers), you must add this instance last to allow the other converters a chance to see their types.
| Modifier and Type | Method and Description |
|---|---|
static MoshiConverterFactory |
create()
Create an instance using a default
Moshi instance for conversion. |
static MoshiConverterFactory |
create(com.squareup.moshi.Moshi moshi)
Create an instance using
moshi for conversion. |
Converter<?,okhttp3.RequestBody> |
requestBodyConverter(Type type,
Annotation[] annotations,
Retrofit retrofit) |
Converter<okhttp3.ResponseBody,?> |
responseBodyConverter(Type type,
Annotation[] annotations,
Retrofit retrofit) |
stringConverterpublic static MoshiConverterFactory create()
Moshi instance for conversion.public static MoshiConverterFactory create(com.squareup.moshi.Moshi moshi)
moshi for conversion.public Converter<okhttp3.ResponseBody,?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit)
responseBodyConverter in class Converter.Factorypublic Converter<?,okhttp3.RequestBody> requestBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit)
requestBodyConverter in class Converter.FactoryCopyright © 2016 Square, Inc.. All rights reserved.