public final class ProtoConverterFactory
extends retrofit2.Converter.Factory
This converter only applies for types which extend from MessageLite (or one of its
subclasses).
| Modifier and Type | Method and Description |
|---|---|
static ProtoConverterFactory |
create() |
static ProtoConverterFactory |
createWithRegistry(com.google.protobuf.ExtensionRegistryLite registry)
Create an instance which uses
registry when deserializing. |
retrofit2.Converter<?,okhttp3.RequestBody> |
requestBodyConverter(java.lang.reflect.Type type,
java.lang.annotation.Annotation[] parameterAnnotations,
java.lang.annotation.Annotation[] methodAnnotations,
retrofit2.Retrofit retrofit) |
retrofit2.Converter<okhttp3.ResponseBody,?> |
responseBodyConverter(java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations,
retrofit2.Retrofit retrofit) |
ProtoConverterFactory |
withStreaming()
Return a new factory which streams serialization of request messages to bytes on the HTTP thread
This is either the calling thread for
Call.execute(), or one of OkHttp's background
threads for Call.enqueue(retrofit2.Callback<T>). |
public static ProtoConverterFactory create()
public static ProtoConverterFactory createWithRegistry(@Nullable com.google.protobuf.ExtensionRegistryLite registry)
registry when deserializing.public ProtoConverterFactory withStreaming()
Call.execute(), or one of OkHttp's background
threads for Call.enqueue(retrofit2.Callback<T>). Response bytes are always converted to message instances on
one of OkHttp's background threads.@Nullable
public retrofit2.Converter<okhttp3.ResponseBody,?> responseBodyConverter(java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations,
retrofit2.Retrofit retrofit)
responseBodyConverter in class retrofit2.Converter.Factory@Nullable
public retrofit2.Converter<?,okhttp3.RequestBody> requestBodyConverter(java.lang.reflect.Type type,
java.lang.annotation.Annotation[] parameterAnnotations,
java.lang.annotation.Annotation[] methodAnnotations,
retrofit2.Retrofit retrofit)
requestBodyConverter in class retrofit2.Converter.Factory