public interface FeatureManager
FeatureManager is the central class in Togglz. It's typically obtained using
FeatureContext.getFeatureManager().| Modifier and Type | Method and Description |
|---|---|
List<ActivationStrategy> |
getActivationStrategies()
Provides access to the
ActivationStrategy list known by the manager |
FeatureUser |
getCurrentFeatureUser()
Get the current feature user.
|
Set<Feature> |
getFeatures()
Provides access to all features the manager is responsible for.
|
FeatureState |
getFeatureState(Feature feature)
Returns the
FeatureState for the specified feature. |
FeatureMetaData |
getMetaData(Feature feature)
Returns the
FeatureMetaData describing the supplied feature. |
String |
getName()
A unique name for this feature manager.
|
boolean |
isActive(Feature feature)
Checks whether the supplied feature is active or not.
|
void |
setFeatureState(FeatureState state)
Updates the state of a feature.
|
String getName()
Set<Feature> getFeatures()
nullFeatureMetaData getMetaData(Feature feature)
FeatureMetaData describing the supplied feature.feature - The feature to get the metadata forboolean isActive(Feature feature)
UserProvider to obtain the currently acting user as it may be relevant if the feature is enabled only for
specific set of users.feature - The feature to checktrue if the feature is active, false otherwiseFeatureUser getCurrentFeatureUser()
UserProvider to obtain the
user.FeatureUser or null if the UserProvider didn't return any result.FeatureState getFeatureState(Feature feature)
FeatureState for the specified feature. This state represents the current configuration of the
feature and is typically persisted by a StateRepository across JVM restarts. The state includes whether
the feature is enabled or disabled and the use list.feature - The feature to get the state fornull.void setFeatureState(FeatureState state)
state - The new feature state.List<ActivationStrategy> getActivationStrategies()
ActivationStrategy list known by the managerActivationStrategyCopyright © 2018. All Rights Reserved.