Package com.pain001.sdk
Class Pain001Client.Builder
java.lang.Object
com.pain001.sdk.Pain001Client.Builder
- Enclosing class:
Pain001Client
Builds a
Pain001Client.-
Method Summary
Modifier and TypeMethodDescriptionAn API key, sent asAuthorization: Bearer <key>; null sends none.The server's base URL, for examplehttp://127.0.0.1:8000: http or https, with a host, and no query or fragment.build()Builds the client.retryPolicy(RetryPolicy retryPolicy) RetriesGETcalls underretryPolicy; null (the default) sends every request once.The connect and per-request timeout; 30 seconds when not set.
-
Method Details
-
baseUrl
The server's base URL, for examplehttp://127.0.0.1:8000: http or https, with a host, and no query or fragment. A trailing slash is ignored.- Parameters:
baseUrl- the server's base URL- Returns:
- this builder
-
apiKey
An API key, sent asAuthorization: Bearer <key>; null sends none.- Parameters:
apiKey- the key, or null- Returns:
- this builder
-
timeout
The connect and per-request timeout; 30 seconds when not set.- Parameters:
timeout- a positive duration- Returns:
- this builder
-
retryPolicy
RetriesGETcalls underretryPolicy; null (the default) sends every request once.POSTcalls are never retried.- Parameters:
retryPolicy- the policy, or null for none- Returns:
- this builder
-
build
Builds the client.- Returns:
- the immutable, thread-safe client
- Throws:
IllegalArgumentException- when the base URL is missing or malformed, or the timeout is not positive
-