Class 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 Detail

      • PercentageFilter

        public PercentageFilter()
    • Method Detail

      • 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