Class FeatureManager
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
@Component("FeatureManagement")
@ConfigurationProperties(prefix="feature-management")
public class FeatureManager
extends HashMap<String,Object>
Holds information on Feature Management properties and can check if a given feature is enabled.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionFeatureManager(FeatureManagementConfigProperties properties) Used to evaluate whether a feature is enabled or disabled. -
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
FeatureManager
Used to evaluate whether a feature is enabled or disabled.- Parameters:
properties- Configuration options for Feature Management
-
-
Method Details
-
isEnabledAsync
Checks to see if the feature is enabled. If enabled it check each filter, once a single filter returns true it returns true. If no filter returns true, it returns false. If there are no filters, it returns true. If feature isn't found it returns false.- Parameters:
feature- Feature being checked.- Returns:
- state of the feature
- Throws:
FilterNotFoundException- file not found
-
putAll
-
getAllFeatureNames
Returns the names of all features flags- Returns:
- a set of all feature names
-