Class ForceGroupsOptionsStrings


  • public class ForceGroupsOptionsStrings
    extends java.lang.Object
    Owns utility functions to convert from/to a string value (force groups string) that usually comes from URL query, cookie, or HTTP header.

    The format of the force groups strings is

    • It's a concatenation of string elements separated by commas. (e.g., my_btn_tst1,default_to_fallback)
    • Each element represents a forced test group, or an option.
    • A forced group is specified by a test name followed by a bucket value (e.g., my_btn_tst1)
    • A forced payload is specified by a force group followed by a semicolon and a payload definition (e.g., my_btn_tst1;doubleValue:0.2)
    • A option is specified by predefined tokens that doesn't contain integers (e.g., default_to_fallback)
    • If two elements conflict (e.g., specifying different buckets for the same test), the latter takes precedence
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String generateForceGroupsString​(ForceGroupsOptions options)  
      static ForceGroupsOptions parseForceGroupsString​(java.lang.String forceGroupsString)  
      static ForceGroupsOptions parseForceGroupsString​(java.lang.String forceGroupsString, java.util.Set<java.lang.String> forcePayloadTests)  
      static Payload parseForcePayloadString​(java.lang.String payloadString)
      The format of the payloadString is the following: payloadType:payloadValue Where payloadType is one of the 7 payload types supported by Proctor (stringValue, stringArray, doubleValue, longValue, longArray, map) If payloadValue is an array is expected in the following format: [value,value,value] If payloadValue is a map expecting following format: [key:value,key:value,key:value]
      • Methods inherited from class java.lang.Object

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

      • parseForceGroupsString

        @Nonnull
        public static ForceGroupsOptions parseForceGroupsString​(@Nullable
                                                                java.lang.String forceGroupsString)
      • parseForceGroupsString

        @Nonnull
        public static ForceGroupsOptions parseForceGroupsString​(@Nullable
                                                                java.lang.String forceGroupsString,
                                                                java.util.Set<java.lang.String> forcePayloadTests)
      • parseForcePayloadString

        @Nullable
        public static Payload parseForcePayloadString​(java.lang.String payloadString)
        The format of the payloadString is the following:
        • payloadType:payloadValue
        • Where payloadType is one of the 7 payload types supported by Proctor (stringValue, stringArray, doubleValue, longValue, longArray, map)
        • If payloadValue is an array is expected in the following format: [value,value,value]
        • If payloadValue is a map expecting following format: [key:value,key:value,key:value]
      • generateForceGroupsString

        public static java.lang.String generateForceGroupsString​(ForceGroupsOptions options)