Class OptionsValidator
java.lang.Object
growthbook.sdk.java.multiusermode.configurations.OptionsValidator
Validates
Options once, at client start-up, so misconfigurations are reported up front with
a clear message instead of surfacing later as an opaque fetch failure.
All independent problems are collected and reported together, so a caller fixing several misconfigured options sees every issue at once rather than one per restart.
Checks performed:
apiHostis present and a syntactically validhttp(s)URL.clientKeyis present.swrTtlSeconds(refresh interval) is positive when set.backgroundFetchIntervalis non-negative when set.remoteEvalCacheTtlSecondsis positive when set.- No contradictory cache configuration (e.g. a
cacheManagersupplied while caching is disabled, orCacheMode.CUSTOMwithout acacheManager). - Remote-eval incompatibilities, delegated to
RemoteEvalOptionsValidator#remoteEvalViolationsso all problems surface together.
-
Method Summary
-
Method Details
-
validate
Validates the supplied options, throwing when any option is invalid or contradictory.- Parameters:
options- client options to validate;nullis treated as nothing to validate- Throws:
InvalidOptionsException- listing every problem found (a subtype ofIllegalArgumentException)
-
findViolations
Collects every validation problem without throwing.- Parameters:
options- client options to inspect;nullyields an empty list- Returns:
- an immutable list of human-readable problem descriptions, empty when valid
-