-
Notifications
You must be signed in to change notification settings - Fork 13
FeatureFlag
STATUS: ACTIVE
Provides a unified, simple and testable api for feature flags
Group FeatureFlag
Default constructor. defaults to setting the dataProvider to a new instance of the FeatureFlagDataProvider
TESTVISIBLE
Private constructor. Accepts a previously constructed Feature Flag Data Provider object. Used only during testing.
Param | Description |
---|---|
dataProvider |
FeatureFlagDataProvider a previously constructed FFDataProvider object |
TESTVISIBLE
The API of this library enables an enabled feature to have an optional String value. However, if the feature is not defined in metadata, the value will be null. This ... could be less than deterministic, so this will always return a string. When undefined by metadata, the value returned is defined here.
TESTVISIBLE
This property enables optional (testing) injection of a data provider. Because this library relies on custom metadata that has to be deployed, I needed to provide a way to inject a data provider.
Returns the value of the specified feature flag This method is deterministic. It will always return a non-null String In situations where the requested feature flag is not enabled, this method returns the value specified above as FF_NOT_ENABLED
Param | Description |
---|---|
featureFlagName |
String name of the feature flag |
Type | Description |
---|---|
String | String |
Returns true if the specified feature flag is enabled This is the main method of the FeatureFlag library. It checks three methods of feature enablement:
1. Global metadata enablement on the Feature_Flag__mdt
record
2. Enablement through a permission set that is shared between the running user and the feature flag's related list of Feature_Flag_Enabled_For__mdt
records
3. Enablement through a list of custom permissions defined by FF_Enabled_For_Custom_Permission__mdt
records.
Param | Description |
---|---|
featureFlagName |
String name of the feature flag |
Type | Description |
---|---|
Boolean | Boolean |
Convenience method for determining if a feature flag is not enabled
Param | Description |
---|---|
featureFlag |
String name of flag to check |
Type | Description |
---|---|
Boolean | Boolean |
TESTVISIBLE
Logical test for global enablement of a feature
Param | Description |
---|---|
featureFlagName |
String name of the feature flag |
Type | Description |
---|---|
Boolean | Boolean |
TESTVISIBLE
TESTVISIBLE
Logical test for per-user enablement of a feature
Param | Description |
---|---|
featureFlagName |
String name of the feature flag |
Type | Description |
---|---|
Boolean | Boolean |
TESTVISIBLE
Logic gate for determining if a feature flag is enabled for this user based on a custom permission
Param | Description |
---|---|
featureFlagName |
String name of the feature flag |
Type | Description |
---|---|
Boolean | Boolean |