Package org.apache.sling.featureflags
Interface Features
-
@ProviderType public interface Features
TheFeatures
service is the applications access point to the Feature Flag functionality. It can be used to query the available features and to create client contexts to be used for enabled feature checking.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Feature
getFeature(java.lang.String name)
Returns the feature with the given name.Feature[]
getFeatures()
Get the list of all (known) features.boolean
isEnabled(java.lang.String name)
Returnstrue
if a feature with the given name is known and enabled under the currentExecutionContext
.
-
-
-
Method Detail
-
getFeatures
Feature[] getFeatures()
Get the list of all (known) features.Features are known if they are registered as
Feature
services or are configured with OSGi configuration whose factory PID isorg.apache.sling.featureflags.Feature
.- Returns:
- The known features
-
getFeature
Feature getFeature(java.lang.String name)
Returns the feature with the given name.Features are known if they are registered as
Feature
services or are configured with OSGi configuration whose factory PID isorg.apache.sling.featureflags.Feature
.- Parameters:
name
- The name of the feature.- Returns:
- The feature or
null
if not known or the name is an empty string ornull
.
-
isEnabled
boolean isEnabled(java.lang.String name)
Returnstrue
if a feature with the given name is known and enabled under the currentExecutionContext
.Features are known if they are registered as
Feature
services or are configured with OSGi configuration whose factory PID isorg.apache.sling.featureflags.Feature
.- Parameters:
name
- The name of the feature to check for enablement.- Returns:
true
if the named feature is known and enabled. Specificallyfalse
is also returned if the named feature is not known.
-
-