Package com.tnsai.flags
Class EnvFeatureFlag
java.lang.Object
com.tnsai.flags.EnvFeatureFlag
- All Implemented Interfaces:
FeatureFlag
Env-backed
FeatureFlag (TAN-3392).
Reads TNSAI_FLAG_<NAME> and optional
TNSAI_FLAG_<NAME>_ALLOW:
on/off— hard switch0–100— percent rollout, hashed on tenant (else agent) so the same identity is stable- allow-list — comma-separated tenant or agent ids, honoured
even at
0% - unset —
defaultWhenUnset(new flags:false)
-
Field Summary
FieldsFields inherited from interface com.tnsai.spi.FeatureFlag
GOAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEnabled(String flag, FlagContext context) booleanisEnabled(String flag, FlagContext context, boolean defaultWhenUnset) boolean
-
Field Details
-
ENV_PREFIX
- See Also:
-
-
Constructor Details
-
EnvFeatureFlag
public EnvFeatureFlag() -
EnvFeatureFlag
-
-
Method Details
-
isEnabled
- Specified by:
isEnabledin interfaceFeatureFlag- Parameters:
flag- flag name; compared case-insensitivelycontext- tenant/agent identity; nevernull(useFlagContext.empty())- Returns:
trueif the flag is on for this context
-
isEnabled
- Parameters:
defaultWhenUnset- used only when neither the value env nor the allow-list env is set
-
isSet
-