Package io.unlaunch.engine
Class UnlaunchUser
java.lang.Object
io.unlaunch.engine.UnlaunchUser
public class UnlaunchUser
extends java.lang.Object
- Author:
- umermansoor
-
Method Summary
Modifier and Type Method Description voidclearAllAttributes()static UnlaunchUsercreate(java.lang.String id)static UnlaunchUsercreateAnonymous()static UnlaunchUsercreateWithAttributes(java.lang.String id, UnlaunchAttribute... attributes)booleanequals(java.lang.Object o)Returns true if the given UnlaunchUser object has same id as this object and the user attributes map has the same mappings as this map.java.util.Map<java.lang.String,io.unlaunch.engine.UnlaunchValue>getAllAttributes()Returns a map of user attributes with values.java.lang.ObjectgetAttribute(java.lang.String key)Returns the value to which the specified key is mapped, ornullif attributes map do not have the key.java.lang.StringgetId()Returns id of the UnlaunchUserinthashCode()voidputAttribute(java.lang.String key, java.lang.Object value)Key should be non-null and non-empty string.voidsetAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
-
Method Details
-
create
-
createWithAttributes
public static UnlaunchUser createWithAttributes(java.lang.String id, UnlaunchAttribute... attributes) -
createAnonymous
-
getAllAttributes
public java.util.Map<java.lang.String,io.unlaunch.engine.UnlaunchValue> getAllAttributes()Returns a map of user attributes with values.- Returns:
- map of user attributes
-
setAttributes
public void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes) -
putAttribute
public void putAttribute(java.lang.String key, java.lang.Object value)Key should be non-null and non-empty string. key should match to the attribute name used in the rule conditions.- Parameters:
key- attribute keyvalue- attribute value
-
getAttribute
public java.lang.Object getAttribute(java.lang.String key)Returns the value to which the specified key is mapped, ornullif attributes map do not have the key.- Parameters:
key- the key whose associated value is to be returned- Returns:
- the value to which the specified key is mapped, or
nullif attributes do not contain this key - Throws:
java.lang.NullPointerException- if the specified key is null or is empty.
-
clearAllAttributes
public void clearAllAttributes() -
getId
public java.lang.String getId()Returns id of the UnlaunchUser- Returns:
- id of the user
-
equals
public boolean equals(java.lang.Object o)Returns true if the given UnlaunchUser object has same id as this object and the user attributes map has the same mappings as this map. key should match to the attribute name used in the rule conditions.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-