Class FeatureManager
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- com.azure.spring.cloud.feature.manager.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:
- Serialized Form
-
-
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
Constructors Constructor Description FeatureManager(FeatureManagementConfigProperties properties)Used to evaluate whether a feature is enabled or disabled.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getAllFeatureNames()Returns the names of all features flagsMono<Boolean>isEnabledAsync(String feature)Checks to see if the feature is enabled.voidputAll(Map<? extends String,? extends Object> m)-
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, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
FeatureManager
public FeatureManager(FeatureManagementConfigProperties properties)
Used to evaluate whether a feature is enabled or disabled.- Parameters:
properties- Configuration options for Feature Management
-
-
Method Detail
-
isEnabledAsync
public Mono<Boolean> isEnabledAsync(String feature) throws FilterNotFoundException
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
-
-