Package ai.spice

Class SpiceClientBuilder

java.lang.Object
ai.spice.SpiceClientBuilder

public class SpiceClientBuilder extends Object
Builder class for creating instances of SpiceClient.
  • Method Details

    • withFlightAddress

      public SpiceClientBuilder withFlightAddress(URI flightAddress)
      Sets the client's flight address
      Parameters:
      flightAddress - The URI of the flight address
      Returns:
      The current instance of SpiceClientBuilder for method chaining.
    • withHttpAddress

      public SpiceClientBuilder withHttpAddress(URI httpAddress)
      Sets the client's HTTP address
      Parameters:
      httpAddress - The URI of the HTTP address
      Returns:
      The current instance of SpiceClientBuilder for method chaining.
    • withApiKey

      public SpiceClientBuilder withApiKey(String apiKey)
      Sets the client's Api Key.
      Parameters:
      apiKey - The Spice Cloud api key
      Returns:
      The current instance of SpiceClientBuilder for method chaining.
      Throws:
      IllegalArgumentException - Thrown when the apiKey is in wrong format.
    • withSpiceCloud

      public SpiceClientBuilder withSpiceCloud() throws URISyntaxException
      Sets the client's flight address to default Spice Cloud address.
      Returns:
      The current instance of SpiceClientBuilder for method chaining.
      Throws:
      URISyntaxException - Thrown when the URI syntax is incorrect.
    • withMaxRetries

      public SpiceClientBuilder withMaxRetries(int maxRetries)
      Sets the maximum number of connection retries for the client.
      Parameters:
      maxRetries - The maximum number of connection retries
      Returns:
      The current instance of SpiceClientBuilder for method chaining.
    • build

      public SpiceClient build()
      Creates SpiceClient with provided parameters.
      Returns:
      The SpiceClient instance