Core API Reference
Reference for evaluating features in a total, deterministic runtime path.
Feature.evaluate(context, registry): T
Standard evaluation API.
fun <T : Any, C : Context, M : Namespace> Feature<T, C, M>.evaluate(
context: C,
registry: NamespaceRegistry = namespace,
): T
-
Guarantee: Returns a value of type
Tand never returnsnullfor supported runtime usage. -
Mechanism: Evaluation returns the first matching rule value or the declared default.
-
Boundary: Throws
IllegalStateExceptionif the feature is not registered in the registry.
Example
val enabled: Boolean = AppFeatures.darkMode.evaluate(context)
Behavior
- Resolve the feature definition from the registry.
- If the registry kill-switch is enabled, return the default.
- If the flag is inactive, return the default.
- Evaluate rules by descending specificity.
- Apply ramp-up to the first matching rule.
- Return the rule value or the default.
Observability and explain diagnostics
- Public explain APIs were removed.
- Internal diagnostics are still produced for sibling modules (OpenFeature, observability, telemetry) via internal API opt-in.
- Application code should use
evaluate(...)as the public entrypoint.