public final class RestClient extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RestClient.Builder
The builder class for building a REST client.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the HTTP client and recycles the resources associated.
|
void |
closeAndWait()
Closes the HTTP client, recycles the resources associated, and waits
for 60 seconds for all the threads to be recycled.
|
ServiceClientCredentials |
credentials() |
CustomHeadersInterceptor |
headers() |
okhttp3.OkHttpClient |
httpClient() |
LogLevel |
logLevel() |
RestClient.Builder |
newBuilder()
Create a new builder for a new Rest Client with the same configurations on this one.
|
ResponseBuilder.Factory |
responseBuilderFactory() |
retrofit2.Retrofit |
retrofit() |
SerializerAdapter<?> |
serializerAdapter() |
RestClient |
withLogLevel(LogLevel logLevel)
Set the current HTTP traffic logging level.
|
public CustomHeadersInterceptor headers()
public SerializerAdapter<?> serializerAdapter()
public ResponseBuilder.Factory responseBuilderFactory()
public okhttp3.OkHttpClient httpClient()
OkHttpClient
instancepublic retrofit2.Retrofit retrofit()
Retrofit
instancepublic ServiceClientCredentials credentials()
public LogLevel logLevel()
public RestClient withLogLevel(LogLevel logLevel)
logLevel
- the logging level enumpublic RestClient.Builder newBuilder()
@Beta(value=V1_1_0) public void close()
@Beta(value=V1_1_0) public void closeAndWait() throws InterruptedException
InterruptedException
- thrown when the 60-sec wait is interruptedCopyright © 2019. All rights reserved.