Package com.cercalia.sdk
Class CercaliaConfig
java.lang.Object
com.cercalia.sdk.CercaliaConfig
Configuration for the Cercalia SDK.
Holds the necessary credentials (API key) and connection settings (base URL) required to interact with Cercalia Web Services.
Typical instantiation:
CercaliaConfig config = new CercaliaConfig("YOUR_API_KEY");
// Or from environment variables CERCALIA_API_KEY
CercaliaConfig envConfig = CercaliaConfig.fromEnvironment();
-
Constructor Summary
ConstructorsConstructorDescriptionCercaliaConfig(@NotNull String apiKey) Creates a new CercaliaConfig with the specified API key and default base URL.CercaliaConfig(@NotNull String apiKey, @NotNull String baseUrl) Creates a new CercaliaConfig with the specified API key and base URL. -
Method Summary
Modifier and TypeMethodDescriptionstatic CercaliaConfigCreates a CercaliaConfig from environment variables.@NotNull StringReturns the API key.@NotNull StringReturns the base URL.static StringReturns the default base URL for Cercalia API.toString()
-
Constructor Details
-
CercaliaConfig
Creates a new CercaliaConfig with the specified API key and default base URL.- Parameters:
apiKey- the Cercalia API key
-
CercaliaConfig
Creates a new CercaliaConfig with the specified API key and base URL.- Parameters:
apiKey- the Cercalia API keybaseUrl- the base URL for API requests
-
-
Method Details
-
fromEnvironment
Creates a CercaliaConfig from environment variables. Uses CERCALIA_API_KEY and CERCALIA_BASE_URL (optional).- Returns:
- a new CercaliaConfig instance
- Throws:
IllegalStateException- if CERCALIA_API_KEY is not set
-
getApiKey
Returns the API key.- Returns:
- the API key
-
getBaseUrl
Returns the base URL.- Returns:
- the base URL
-
getDefaultBaseUrl
Returns the default base URL for Cercalia API.- Returns:
- the default base URL
-
toString
-