public final class WireConverterFactory
extends retrofit2.Converter.Factory
This converter only applies for types which extend from Message.
| Modifier and Type | Method and Description |
|---|---|
static WireConverterFactory |
create()
Create an instance which serializes request messages to bytes eagerly on the caller thread
when either
Call.execute() or Call.enqueue(retrofit2.Callback<T>) is called. |
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) |
WireConverterFactory |
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 WireConverterFactory create()
Call.execute() or Call.enqueue(retrofit2.Callback<T>) is called. Response bytes are
always converted to message instances on one of OkHttp's background threads.public WireConverterFactory 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