Toggle
Types
This annotation is required. It specifies the default value of the feature flag when it's not remotely defined
The feature name the name of the feature parentName the name of the parent feature, or null if the feature has no parent (root feature)
This annotation is optional. It will make the feature flag ALWAYS enabled for internal builds
This represents the state of a Toggle
It is possible to add feature Targets. To do that, just add the property inside the Target and implement the TargetMatcherPlugin to do the matching
Functions
WARNING: This method always returns the cohort assigned regardless it the experiment is still enabled or not.
The usage of this API is only useful for internal/dev settings/features If you find yourself having to call this method in production code, then YOU'RE DOING SOMETHING WRONG The raw state is the stored state. isEnabled method takes the raw state and computes whether the feature should be enabled or disabled. eg. by factoring in State.minSupportedVersion and State.maxSupportedVersion amongst others.
This method - Returns whether the feature flag state is enabled or disabled. - It is not affected by experiment cohort assignment. It just checks whether the feature is enabled or not. - It considers all other constraints like targets, minSupportedVersion, maxSupportedVersion, etc.
Convenience method that checks if getCohort is not null
The usage of this API is only useful for internal/dev settings/features If you find yourself having to call this method in production code, then YOU'RE DOING SOMETHING WRONG