Package io.featureflow.client.model
Class Rule
java.lang.Object
io.featureflow.client.model.Rule
A Rule holds and Audience (Who to show to) and a list of VariantSplits (what to show them)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerate the Variant value using sha1hex 1.getSplitKey(long variantValue) getVariantSplitKey(String userId, String featureKey, String salt) longgetVariantValue(String hash) booleanmatches(FeatureflowUser user) voidsetAudience(Audience audience) voidsetVariantSplits(List<VariantSplit> variantSplits)
-
Field Details
-
ANONYMOUS
- See Also:
-
-
Constructor Details
-
Rule
public Rule()
-
-
Method Details
-
setAudience
-
getAudience
-
getVariantSplits
-
setVariantSplits
-
matches
-
getVariantSplitKey
-
getSplitKey
-
getHash
Generate the Variant value using sha1hex 1. We generate an equally distributed string of hex values, parse it to a length of 15, thats the max we can get before we blow out of the long range (fffffffffffffff)16 = (1152921504606846975)10 2. We turn that hex into its representative number 3. We find the remainder from 100 and use that as our variant bucket- Parameters:
userId- - the users unique identifier key or bucket keyfeatureKey- - The feature key we are testingsalt- - A salt value- Returns:
- hash - the hashed value
-
getVariantValue
-