Package com.indeed.proctor.common
Class ForceGroupsOptionsStrings
- java.lang.Object
-
- com.indeed.proctor.common.ForceGroupsOptionsStrings
-
public class ForceGroupsOptionsStrings extends java.lang.ObjectOwns 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.StringgenerateForceGroupsString(ForceGroupsOptions options)static ForceGroupsOptionsparseForceGroupsString(java.lang.String forceGroupsString)static ForceGroupsOptionsparseForceGroupsString(java.lang.String forceGroupsString, java.util.Set<java.lang.String> forcePayloadTests)static PayloadparseForcePayloadString(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]
-
-
-
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)
-
-