public final class JsonConverterFactory
extends retrofit2.Converter.Factory
Because Jackson 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 | Field and Description |
|---|---|
private com.fasterxml.jackson.databind.ObjectMapper |
mapper |
| Modifier | Constructor and Description |
|---|---|
private |
JsonConverterFactory() |
| Modifier and Type | Method and Description |
|---|---|
static JsonConverterFactory |
create()
Create an instance using
mapper for conversion. |
retrofit2.Converter<?,okhttp3.RequestBody> |
requestBodyConverter(Type type,
Annotation[] parameterAnnotations,
Annotation[] methodAnnotations,
retrofit2.Retrofit retrofit) |
retrofit2.Converter<okhttp3.ResponseBody,?> |
responseBodyConverter(Type type,
Annotation[] annotations,
retrofit2.Retrofit retrofit) |
public static JsonConverterFactory create()
mapper for conversion.public retrofit2.Converter<okhttp3.ResponseBody,?> responseBodyConverter(Type type, Annotation[] annotations, retrofit2.Retrofit retrofit)
responseBodyConverter in class retrofit2.Converter.Factorypublic retrofit2.Converter<?,okhttp3.RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, retrofit2.Retrofit retrofit)
requestBodyConverter in class retrofit2.Converter.FactoryCopyright © 2024. All rights reserved.