Package org.apache.sling.featureflags
Interface Feature
- 
@ConsumerType public interface FeatureA feature is defined by its name. Features are registered as OSGi services.Feature
namesshould be globally unique. If multiple features have the same name, the feature with the highest service ranking is accessible through theFeaturesservice while those with lower service rankings are ignored.This interface is expected to be implemented by feature providers.
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetDescription()The description of the feature.java.lang.StringgetName()The name of the feature.booleanisEnabled(ExecutionContext context)Checks whether the feature is enabled for the given execution context. 
 - 
 
- 
- 
Method Detail
- 
getName
java.lang.String getName()
The name of the feature.- Returns:
 - The name of this feature which must not be 
nullor an empty string. 
 
- 
getDescription
java.lang.String getDescription()
The description of the feature.- Returns:
 - The optional description of this feature, which may be
         
nullor an empty string. 
 
- 
isEnabled
boolean isEnabled(ExecutionContext context)
Checks whether the feature is enabled for the given execution context.Multiple calls to this method may but are not required to return the same value. For example the return value may depend on the time of day, some random number or some information provided by the given
ExecutionContext.This method is called by the
Featuremanager and is not intended to be called by application code directly.- Parameters:
 context- TheExecutionContextproviding a context to evaluate whether the feature is enabled or not. Implementations must not hold on to this context instance or the values provided for longer than executing this method.- Returns:
 trueif thisFeatureis enabled in the givenExecutionContext.
 
 - 
 
 -