Package retrofit2.converter.protobuf
Class ProtoConverterFactory
java.lang.Object
retrofit2.Converter.Factory
retrofit2.converter.protobuf.ProtoConverterFactory
public final class ProtoConverterFactory
extends retrofit2.Converter.Factory
A converter which uses Protocol Buffers.
This converter only applies for types which extend from MessageLite (or one of its
subclasses).
-
Method Summary
Modifier and Type Method Description static ProtoConverterFactorycreate()static ProtoConverterFactorycreateWithRegistry(com.google.protobuf.ExtensionRegistryLite registry)Create an instance which usesregistrywhen 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)
-
Method Details
-
create
-
createWithRegistry
public static ProtoConverterFactory createWithRegistry(@Nullable com.google.protobuf.ExtensionRegistryLite registry)Create an instance which usesregistrywhen deserializing. -
responseBodyConverter
@Nullable public retrofit2.Converter<okhttp3.ResponseBody,?> responseBodyConverter(java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, retrofit2.Retrofit retrofit)- Overrides:
responseBodyConverterin classretrofit2.Converter.Factory
-
requestBodyConverter
@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)- Overrides:
requestBodyConverterin classretrofit2.Converter.Factory
-