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 Details

    • PercentageFilter

      public PercentageFilter()
  • Method Details

    • evaluate

      public boolean evaluate(FeatureFilterEvaluationContext context)
      Performs a percentage based evaluation to determine whether a feature is enabled.
      Specified by:
      evaluate in interface FeatureFilter
      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