S - Type of the services interface specific for this configuration.public static final class ServiceManager.ServicesConfiguration<S> extends Object
Retrofit along with its corresponding
Retrofit.Builder that are used to build a PROXY instance for services interface for
the current configuration.
Created instance of services PROXY is cached so it does not need to be created each time it
is requested via ServiceManager.services(Class). This instance of PROXY is re-created
only in case where there has been performed some configuration change and invalidate()
has been called to indicate the services PROXY is no longer valid.
| Modifier and Type | Method and Description |
|---|---|
void |
invalidate()
Invalidates the current configuration.
|
Retrofit |
retrofit()
Returns the Retrofit instance for the current configuration.
|
Retrofit.Builder |
retrofitBuilder()
Returns the Retrofit builder that is used to build instance of Retrofit and instance of
services PROXY for this services configuration.
|
@NonNull public Retrofit.Builder retrofitBuilder()
When any of the current parameters of the builder is changed do not forget to call
invalidate() so the change is accepted and new updated services PROXY is created
in next call to ServiceManager.services(Class).
ServiceManager.services(Class).public void invalidate()
ServiceManager.services(Class)
with services interface associated with this configuration will create a new instance
of the desired services PROXY.@NonNull public Retrofit retrofit()
retrofitBuilder(),
invalidate()