Class PercentageFilter
java.lang.Object
com.azure.spring.cloud.feature.manager.feature.filters.PercentageFilter
- All Implemented Interfaces:
FeatureFilter
@Component("PercentageFilter")
public class PercentageFilter
extends Object
implements FeatureFilter
A feature filter that can be used to activate a feature based on a random percentage.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate(FeatureFilterEvaluationContext context) Performs a percentage based evaluation to determine whether a feature is enabled.
-
Constructor Details
-
PercentageFilter
public PercentageFilter()
-
-
Method Details
-
evaluate
Performs a percentage based evaluation to determine whether a feature is enabled.- Specified by:
evaluatein interfaceFeatureFilter- Parameters:
context- The feature evaluation context.- Returns:
- True if the feature is enabled, false otherwise.
- Throws:
NumberFormatException- if the percentage filter setting is not a parsable double
-