Class DoclingServeClient.DoclingServeClientBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C,B>>
- Type Parameters:
C- the type ofDoclingServeClientbeing builtB- the type of the builder implementation
- All Implemented Interfaces:
ai.docling.api.serve.DoclingServeApi.DoclingApiBuilder<C,B>
- Direct Known Subclasses:
DoclingServeJackson2Client.Builder,DoclingServeJackson3Client.Builder
- Enclosing class:
- DoclingServeClient
DoclingServeClient.
This builder class provides methods for configuring shared properties such as the base URL and the HTTP client. Concrete subclasses may extend this builder to add additional configuration options.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected constructor for use by subclasses ofDoclingServeClient.DoclingServeClientBuilder.protectedDoclingServeClientBuilder(DoclingServeClient doclingClient) Initializes a newDoclingServeClient.DoclingServeClientBuilderinstance using the configuration from the providedDoclingServeClient. -
Method Summary
Modifier and TypeMethodDescriptionSets the base URL for the client.Sets the base URL for the client.httpClientBuilder(HttpClient.Builder httpClientBuilder) Sets the HTTP client builder to be used for creating the underlying HTTP client.logRequests(boolean logRequests) logResponses(boolean logResponses) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.docling.api.serve.DoclingServeApi.DoclingApiBuilder
build, logRequests, logResponses
-
Constructor Details
-
DoclingServeClientBuilder
protected DoclingServeClientBuilder()Protected constructor for use by subclasses ofDoclingServeClient.DoclingServeClientBuilder.Initializes a new instance of the builder with default configuration values. This constructor ensures that the builder cannot be instantiated directly, promoting proper use and extension by subclasses.
-
DoclingServeClientBuilder
Initializes a newDoclingServeClient.DoclingServeClientBuilderinstance using the configuration from the providedDoclingServeClient.- Parameters:
doclingClient- theDoclingServeClientwhose configuration (e.g., base URL) will be used to initialize the builder
-
-
Method Details
-
baseUrl
Sets the base URL for the client.This method configures the base URL that will be used for all API requests executed by the client. The provided URL must be non-null and not blank.
- Parameters:
baseUrl- the base URL to use, as aString- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- ifbaseUrlis null, blank, or invalid
-
baseUrl
Sets the base URL for the client.This method configures the base URL that will be used for all API requests executed by the client. The provided URL must be non-null.
- Parameters:
baseUrl- the base URL to use, as aURI- Returns:
- this builder instance for method chaining
- Throws:
IllegalArgumentException- ifbaseUrlis null
-
httpClientBuilder
Sets the HTTP client builder to be used for creating the underlying HTTP client.This allows customization of HTTP client properties such as timeouts, proxy settings, SSL context, and other connection parameters.
- Parameters:
httpClientBuilder- theHttpClient.Builderto use- Returns:
- this
DoclingServeJackson3Client.Builderinstance for method chaining
-
logRequests
- Specified by:
logRequestsin interfaceai.docling.api.serve.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>>
-
logResponses
- Specified by:
logResponsesin interfaceai.docling.api.serve.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C, B>>
-