Package io.rtr.alchemy.identities
Class Identity
java.lang.Object
io.rtr.alchemy.identities.Identity
Identifies a unique entity whose hash code is used for treatments allocation
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributesMap.BuilderConvenience method for getting an attributes map builderabstract AttributesMapgenerates a list of attributes that describe this identity for filteringlongcomputeHash(int seed, Set<String> hashAttributes, AttributesMap attributes) generates a hash code used to assign identity to treatmentgetSupportedAttributes(Class<T> clazz) Get a list of possible attribute values that can be returned by this identityprotected IdentityBuilderidentity(int seed) Convenience method for getting an identity builder given a seed
-
Field Details
-
EMPTY
-
-
Constructor Details
-
Identity
public Identity()
-
-
Method Details
-
getSupportedAttributes
Get a list of possible attribute values that can be returned by this identity -
computeHash
generates a hash code used to assign identity to treatment- Parameters:
seed- a seed value to randomize the resulting hash from experiment to experiment for the same identityhashAttributes- a set of attributes that should be used to compute the hash codeattributes- a map of attribute values
-
computeAttributes
generates a list of attributes that describe this identity for filtering -
identity
Convenience method for getting an identity builder given a seed -
attributes
Convenience method for getting an attributes map builder
-