Class TestRangeSelector

  • Direct Known Subclasses:
    UnitlessAllocationRangeSelector

    public class TestRangeSelector
    extends java.lang.Object
    This is perhaps not the greatest abstraction the world has seen; is meant to consolidate common functionality needed for different types of choosers WITHOUT using inheritance
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int findMatchingRule​(java.util.Map<java.lang.String,​java.lang.Object> values, java.util.Map<java.lang.String,​TestBucket> testGroups, java.lang.String identifier)
      Deprecated.
      Use findMatchingRuleWithValueExpr(Map, Map) instead, which is more efficient.
      int findMatchingRuleWithValueExpr​(java.util.Map<java.lang.String,​javax.el.ValueExpression> localContext, java.util.Map<java.lang.String,​TestBucket> testGroups, java.lang.String identifier)  
      TestBucket[] getBucketRange​(int index)  
      protected int getMatchingAllocation​(java.util.function.Function<java.lang.String,​java.lang.Boolean> evaluator, java.lang.String identifier)  
      java.lang.String[] getRules()  
      TestBucket getTestBucket​(int value)
      Do not evaluate the rule, do not use the pseudo-random allocation algorithm, do not collect $200.
      ConsumableTestDefinition getTestDefinition()  
      java.lang.String getTestName()  
      protected void printTestBuckets​(java.io.PrintWriter writer, java.util.Map<java.lang.String,​java.lang.String> parameters)
      appends testbuckets in a notation a bit similar to Json
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getBucketRange

        public TestBucket[] getBucketRange​(int index)
      • findMatchingRule

        @Deprecated
        public int findMatchingRule​(@Nonnull
                                    java.util.Map<java.lang.String,​java.lang.Object> values,
                                    @Nonnull
                                    java.util.Map<java.lang.String,​TestBucket> testGroups,
                                    @Nullable
                                    java.lang.String identifier)
        Deprecated.
        Use findMatchingRuleWithValueExpr(Map, Map) instead, which is more efficient.
      • findMatchingRuleWithValueExpr

        public int findMatchingRuleWithValueExpr​(@Nonnull
                                                 java.util.Map<java.lang.String,​javax.el.ValueExpression> localContext,
                                                 @Nonnull
                                                 java.util.Map<java.lang.String,​TestBucket> testGroups,
                                                 @Nullable
                                                 java.lang.String identifier)
      • getMatchingAllocation

        protected int getMatchingAllocation​(java.util.function.Function<java.lang.String,​java.lang.Boolean> evaluator,
                                            @Nullable
                                            java.lang.String identifier)
      • getRules

        @Nonnull
        public java.lang.String[] getRules()
      • getTestBucket

        @CheckForNull
        public TestBucket getTestBucket​(int value)
        Do not evaluate the rule, do not use the pseudo-random allocation algorithm, do not collect $200. This should ONLY be used by privileged code for debugging.
        Parameters:
        value - bucket number
        Returns:
        a TestBucket with the specified value or null if none exists
      • getTestName

        @Nonnull
        public java.lang.String getTestName()
      • printTestBuckets

        protected void printTestBuckets​(@Nonnull
                                        java.io.PrintWriter writer,
                                        @Nonnull
                                        java.util.Map<java.lang.String,​java.lang.String> parameters)
        appends testbuckets in a notation a bit similar to Json