Package ai.spice
Class SpiceClientBuilder
java.lang.Object
ai.spice.SpiceClientBuilder
Builder class for creating instances of SpiceClient.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates SpiceClient with provided parameters.withApiKey(String apiKey) Sets the client's Api Key.withFlightAddress(URI flightAddress) Sets the client's flight addresswithHttpAddress(URI httpAddress) Sets the client's HTTP addresswithMaxRetries(int maxRetries) Sets the maximum number of connection retries for the client.Sets the client's flight address to default Spice Cloud address.
-
Method Details
-
withFlightAddress
Sets the client's flight address- Parameters:
flightAddress- The URI of the flight address- Returns:
- The current instance of SpiceClientBuilder for method chaining.
-
withHttpAddress
Sets the client's HTTP address- Parameters:
httpAddress- The URI of the HTTP address- Returns:
- The current instance of SpiceClientBuilder for method chaining.
-
withApiKey
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
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
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
Creates SpiceClient with provided parameters.- Returns:
- The SpiceClient instance
-