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 void
clearAllAttributes()
static UnlaunchUser
create(java.lang.String id)
static UnlaunchUser
createAnonymous()
static UnlaunchUser
createWithAttributes(java.lang.String id, UnlaunchAttribute... attributes)
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.java.util.Map<java.lang.String,io.unlaunch.engine.UnlaunchValue>
getAllAttributes()
Returns a map of user attributes with values.java.lang.Object
getAttribute(java.lang.String key)
Returns the value to which the specified key is mapped, ornull
if attributes map do not have the key.java.lang.String
getId()
Returns id of the UnlaunchUserint
hashCode()
void
putAttribute(java.lang.String key, java.lang.Object value)
Key should be non-null and non-empty string.void
setAttributes(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, ornull
if 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
null
if 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-