Class SynchronousCallAdapterFactory
- java.lang.Object
-
- retrofit2.CallAdapter.Factory
-
- com.jaredsburrows.retrofit2.adapter.synchronous.SynchronousCallAdapterFactory
-
public final class SynchronousCallAdapterFactory extends retrofit2.CallAdapter.Factory
A synchronousCallAdapter.Factorythat uses the same thread for both I/O and application-level callbacks.Adding this class to
Retrofitallows you to return direct deserialized type from service methods:
or allows you to return deserialized type wrapped ininterface MyService { @GET("user/me") User getUser() }Response:interface MyService { @GET("user/me") Response<User> getUser() }CallAdapter.Factoryreturns the deserialized body for 2XX responses, setsHttpExceptionerrors for non-2XX responses, and for network errors.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static retrofit2.CallAdapter.Factorycreate()retrofit2.CallAdapter<?,?>get(java.lang.reflect.Type returnType, java.lang.annotation.Annotation[] annotations, retrofit2.Retrofit retrofit)
-