Class DoclingServeClient.DoclingServeClientBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C,B>>

java.lang.Object
ai.docling.client.serve.DoclingServeClient.DoclingServeClientBuilder<C,B>
Type Parameters:
C - the type of DoclingServeClient being built
B - 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

public abstract static class DoclingServeClient.DoclingServeClientBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C,B>> extends Object implements ai.docling.api.serve.DoclingServeApi.DoclingApiBuilder<C,B>
Abstract base class for building instances of 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 Details

    • DoclingServeClientBuilder

      protected DoclingServeClientBuilder()
      Protected constructor for use by subclasses of DoclingServeClient.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

      protected DoclingServeClientBuilder(DoclingServeClient doclingClient)
      Initializes a new DoclingServeClient.DoclingServeClientBuilder instance using the configuration from the provided DoclingServeClient.
      Parameters:
      doclingClient - the DoclingServeClient whose configuration (e.g., base URL) will be used to initialize the builder
  • Method Details

    • baseUrl

      public B baseUrl(String 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 a String
      Returns:
      this builder instance for method chaining
      Throws:
      IllegalArgumentException - if baseUrl is null, blank, or invalid
    • baseUrl

      public B baseUrl(URI 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 a URI
      Returns:
      this builder instance for method chaining
      Throws:
      IllegalArgumentException - if baseUrl is null
    • httpClientBuilder

      public B httpClientBuilder(HttpClient.Builder 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 - the HttpClient.Builder to use
      Returns:
      this DoclingServeJackson3Client.Builder instance for method chaining
    • logRequests

      public B logRequests(boolean logRequests)
      Specified by:
      logRequests in interface ai.docling.api.serve.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C,B>>
    • logResponses

      public B logResponses(boolean logResponses)
      Specified by:
      logResponses in interface ai.docling.api.serve.DoclingServeApi.DoclingApiBuilder<C extends DoclingServeClient,B extends DoclingServeClient.DoclingServeClientBuilder<C,B>>