Class ApiClientBuilder
java.lang.Object
de.xima.fc.api.rest.pub.client.form.ApiClientBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionApiClientBuilder(JaxRsAdapter jaxRsAdapter) Creates a new builder for configuring an API client. -
Method Summary
Modifier and TypeMethodDescriptionapiCallInterceptor(ApiCallInterceptor interceptor) Sets the optional interceptor for reacting to and modifying API calls.Helper method to set API key value for the first API key authentication.apiKeyPrefix(String apiKeyPrefix) Helper method to set API key prefix for the first API key authentication.Sets the base path for all API endpoints.bearerToken(String bearerToken) Helper method to set the bearer token for the first HTTP basic authentication.Creates a bundle with all APIs.Creates a new client.dateFormat(DateFormat dateFormat) Set the date format used to parse/format date parameters.dateTimeFormatter(DateTimeFormatter dateTimeFormatter) Set the date time formatter used to parse/format date parameters.defaultCookie(String name, String value) Add a default cookie.defaultCookieMap(Map<String, String> defaultCookieMap) Sets the default cookies applied to each request.defaultHeader(String name, String value) Add a default header.defaultHeaderMap(Map<String, String> defaultHeaderMap) Sets the default headers applied to each request.defaultPropertyMap(Map<String, Object> defaultPropertyMap) Sets the default properties applied to each request.Helper method to set the password for the first HTTP basic authentication.Set the User-Agent header's value (by adding to the default header map).Helper method to set the username for the first HTTP basic authentication.
-
Constructor Details
-
ApiClientBuilder
Creates a new builder for configuring an API client.- Parameters:
jaxRsAdapter- The adapter to use for integrating Jax RS.
-
-
Method Details
-
buildClient
Creates a new client. Usually you can usebuildBundle()unless you need access to low-level methods of the client.- Returns:
- A new immutable client instance with the current settings. Modifications to this builder DO NOT affect the built client.
-
buildBundle
Creates a bundle with all APIs. Usually you should prefer this overbuildClient()unless you need to work with the client directly.- Returns:
- A new immutable API bundle instance with the current settings. Modifications to this builder DO NOT affect the built bundle.
-
dateFormat
Set the date format used to parse/format date parameters.- Parameters:
dateFormat- a date format used to parse/format date parameters- Returns:
- This builder instance for chaining method calls.
-
dateTimeFormatter
Set the date time formatter used to parse/format date parameters.- Parameters:
dateTimeFormatter- A date time formatter used to parse/format date parameters.- Returns:
- This builder instance for chaining method calls.
-
userAgent
Set the User-Agent header's value (by adding to the default header map).- Parameters:
userAgent- the User-Agent header value- Returns:
- This builder instance for chaining method calls.
-
defaultHeaderMap
Sets the default headers applied to each request.- Parameters:
defaultHeaderMap- The new headers to use- Returns:
- This builder instance for chaining method calls.
-
defaultPropertyMap
Sets the default properties applied to each request.- Parameters:
defaultPropertyMap- The new default properties to use- Returns:
- This builder instance for chaining method calls.
-
defaultCookieMap
Sets the default cookies applied to each request.- Parameters:
defaultCookieMap- The new cookies to use.- Returns:
- This builder instance for chaining method calls.
-
defaultHeader
Add a default header.- Parameters:
name- The header's namevalue- The header's value- Returns:
- This builder instance for chaining method calls.
-
defaultCookie
Add a default cookie.- Parameters:
name- The cookies's namevalue- The cookies's value- Returns:
- This builder instance for chaining method calls.
-
basePath
Sets the base path for all API endpoints.- Parameters:
basePath- Base path with the URL of the API.- Returns:
- This builder instance for chaining method calls.
-
apiCallInterceptor
Sets the optional interceptor for reacting to and modifying API calls.- Parameters:
interceptor- The interceptor to use for API calls.- Returns:
- This builder instance for chaining method calls.
-
username
Helper method to set the username for the first HTTP basic authentication.- Parameters:
username- the username- Returns:
- This builder instance for chaining method calls.
-
password
Helper method to set the password for the first HTTP basic authentication.- Parameters:
password- the password- Returns:
- This builder instance for chaining method calls.
-
bearerToken
Helper method to set the bearer token for the first HTTP basic authentication.- Parameters:
bearerToken- the bearer token to use.- Returns:
- This builder instance for chaining method calls.
-
apiKey
Helper method to set API key value for the first API key authentication.- Parameters:
apiKey- the API key- Returns:
- This builder instance for chaining method calls.
-
apiKeyPrefix
Helper method to set API key prefix for the first API key authentication.- Parameters:
apiKeyPrefix- the API key prefix- Returns:
- This builder instance for chaining method calls.
-