public static class ApiConnection.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
ApiConnection |
build()
Builds a new, initially stopped,
ApiConnection. |
ApiConnection.Builder |
callbackWrapper(CallbackWrapper callbackWrapper)
Initializes the value for the
callbackWrapper attribute. |
ApiConnection.Builder |
endpoint(String url)
Initializes the endpoint from the given URL string.
|
ApiConnection.Builder |
endpoint(URI endpoint)
Initializes the value for the
endpoint attribute. |
ApiConnection.Builder |
httpClient(HttpAsyncClient httpClient)
Initializes the value for the
httpClient attribute. |
ApiConnection.Builder |
prettyPrintJson(boolean prettyPrintJson)
Initializes the value for the
prettyPrintJson attribute. |
ApiConnection.Builder |
servicePlanId(String servicePlanId)
Initializes the value for the
servicePlanId attribute. |
ApiConnection |
start()
Builds and starts the defined API connection.
|
ApiConnection.Builder |
token(String token)
Initializes the value for the
token attribute. |
ApiConnection.Builder |
using(ApiConnection instance)
Fill a builder with attribute values from the provided
ApiConnection instance. |
public ApiConnection.Builder endpoint(String url)
url - the URL to the XMS endpointpublic ApiConnection build()
ApiConnection. Before
attempting to interact with XMS it is necessary to start the returned
connection, this is done using ApiConnection.start().
The start() method is recommended for the common case where
the built ApiConnection is immediately started.
IllegalStateException - if any required attributes are missingpublic ApiConnection start()
build() and then immediately calling
ApiConnection.start() on the generated connection object.public final ApiConnection.Builder using(ApiConnection instance)
ApiConnection instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ApiConnection.Builder token(String token)
token attribute.token - The value for tokenthis builder for use in a chained invocationpublic final ApiConnection.Builder servicePlanId(String servicePlanId)
servicePlanId attribute.servicePlanId - The value for servicePlanIdthis builder for use in a chained invocationpublic final ApiConnection.Builder prettyPrintJson(boolean prettyPrintJson)
prettyPrintJson attribute.
If not set, this attribute will have a default value as returned by the initializer of prettyPrintJson.
prettyPrintJson - The value for prettyPrintJsonthis builder for use in a chained invocationpublic final ApiConnection.Builder httpClient(HttpAsyncClient httpClient)
httpClient attribute.
If not set, this attribute will have a default value as returned by the initializer of httpClient.
httpClient - The value for httpClientthis builder for use in a chained invocationpublic final ApiConnection.Builder callbackWrapper(CallbackWrapper callbackWrapper)
callbackWrapper attribute.
If not set, this attribute will have a default value as returned by the initializer of callbackWrapper.
callbackWrapper - The value for callbackWrapperthis builder for use in a chained invocationpublic final ApiConnection.Builder endpoint(URI endpoint)
endpoint attribute.
If not set, this attribute will have a default value as returned by the initializer of endpoint.
endpoint - The value for endpointthis builder for use in a chained invocationCopyright © 2016–2019 CLX Communications. All rights reserved.