Package io.gorules.zen.loader
Class ApiLoaderConfig
java.lang.Object
io.gorules.zen.loader.ApiLoaderConfig
Configuration for ApiDecisionLoader.
Supports flexible header configuration for any HTTP headers you need.
ApiLoaderConfig config = ApiLoaderConfig.builder("https://api.example.com/decisions")
.header("Authorization", "Bearer token123")
.header("X-API-Key", "your-key")
.header("X-Custom-Header", "any-value")
.timeout(Duration.ofSeconds(30))
.caching(true)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for ApiLoaderConfig with flexible header configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic ApiLoaderConfig.BuilderCreate a new builder with the given base URL.Get all headers (static + dynamic) for a request.Get the base URL for API requests.intGet maximum number of retry attempts.Get delay between retry attempts.Get static headers (does not include dynamic headers from provider).Get request timeout duration.booleanCheck if caching is enabled.
-
Method Details
-
builder
Create a new builder with the given base URL.- Parameters:
baseUrl- Base URL for API (e.g., "https://api.example.com/decisions")- Returns:
- Builder instance
-
getAllHeaders
Get all headers (static + dynamic) for a request.- Returns:
- Combined headers map
-
getBaseUrl
Get the base URL for API requests.- Returns:
- Base URL
-
getStaticHeaders
Get static headers (does not include dynamic headers from provider).- Returns:
- Map of static headers
-
getTimeout
Get request timeout duration.- Returns:
- Timeout duration
-
getMaxRetries
public int getMaxRetries()Get maximum number of retry attempts.- Returns:
- Maximum retries
-
getRetryDelay
Get delay between retry attempts.- Returns:
- Retry delay duration
-
isEnableCaching
public boolean isEnableCaching()Check if caching is enabled.- Returns:
- true if caching is enabled
-