public static class RatpackRetrofit.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
<T> T |
build(java.lang.Class<T> service)
Uses this builder to create a Retrofit client implementation.
|
RatpackRetrofit.Builder |
configure(Action<? super Retrofit.Builder> builderAction)
Configure the underlying
Retrofit.Builder instance. |
RatpackRetrofit.Builder |
httpClient(Factory<? extends HttpClient> clientFactory)
Configures a
Factory that supplies the underlying HttpClient to back
client interfaces generated from the return of retrofit() |
Retrofit |
retrofit()
Creates the underlying
Retrofit instance and configures it to interface with HttpClient and Promise . |
public RatpackRetrofit.Builder configure(Action<? super Retrofit.Builder> builderAction)
Retrofit.Builder
instance.
This is used to customize the behavior of Retrofit.
builderAction
- the actions to apply to the Retrofit builderthis
Converter.Factory
,
CallAdapter.Factory
public RatpackRetrofit.Builder httpClient(Factory<? extends HttpClient> clientFactory)
Factory
that supplies the underlying HttpClient
to back
client interfaces generated from the return of retrofit()
By default, the following locations are searched in order, with the first HttpClient
found used to back
the client interfaces.
If no HttpClient
is found, a NotInRegistryException
is thrown.
clientFactory
- a factory that generates a HttpClient to be usedthis
public Retrofit retrofit()
Retrofit
instance and configures it to interface with HttpClient
and Promise
.
The resulting Retrofit instance can be re-used to generate multiple client interfaces which share the same base URI.
public <T> T build(java.lang.Class<T> service)
This is the short form of calling builder.retrofit().create(service)
.
T
- the type of the client interface.service
- the client interface to generate.