Package com.mparticle.identity
Class MParticleUserImpl
- java.lang.Object
-
- com.mparticle.identity.MParticleUserImpl
-
- All Implemented Interfaces:
MParticleUser
public class MParticleUserImpl extends java.lang.Object implements MParticleUser
A class which represents a User.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMParticleUserImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConsentStategetConsentState()Query the ConsentState of this userlonggetFirstSeenTime()The timestamp representing the first time this user was observed on this devicelonggetId()query the MPID of the UserlonggetLastSeenTime()The timestamp representing the last time this user was the "currentUser" on this devicevoidgetSegments(long timeout, java.lang.String endpointId, SegmentListener listener)java.util.Map<java.lang.String,java.lang.Object>getUserAttributes()query the attributes of the Userjava.util.Map<java.lang.String,java.lang.Object>getUserAttributes(UserAttributeListener listener)Query the attributes of the User asynchronously.java.util.Map<MParticle.IdentityType,java.lang.String>getUserIdentities()query the Identities of the UserbooleanincrementUserAttribute(java.lang.String key, int value)increment an attribute for the userbooleanisLoggedIn()Query the "Logged In" status for this user.booleanremoveUserAttribute(java.lang.String key)remove an attribute for the uservoidsetConsentState(ConsentState state)Set the ConsentState for this userbooleansetUserAttribute(java.lang.String key, java.lang.Object value)set a single attribute for the userbooleansetUserAttributeList(java.lang.String key, java.lang.Object value)set a single attribute for the user whose value is an Object, not just a StringbooleansetUserAttributes(java.util.Map<java.lang.String,java.lang.Object> userAttributes)assign attributes to the User in bulkbooleansetUserTag(java.lang.String tag)set a tag for a User.
-
-
-
Method Detail
-
getId
public long getId()
Description copied from interface:MParticleUserquery the MPID of the User- Specified by:
getIdin interfaceMParticleUser- Returns:
- the mpid
-
getUserAttributes
public java.util.Map<java.lang.String,java.lang.Object> getUserAttributes()
Description copied from interface:MParticleUserquery the attributes of the User- Specified by:
getUserAttributesin interfaceMParticleUser- Returns:
- the User's attributes
-
getUserAttributes
public java.util.Map<java.lang.String,java.lang.Object> getUserAttributes(UserAttributeListener listener)
Query the attributes of the User asynchronously.- Specified by:
getUserAttributesin interfaceMParticleUser- Parameters:
listener- a callback for querying User's attributes- Returns:
-
setUserAttributes
public boolean setUserAttributes(java.util.Map<java.lang.String,java.lang.Object> userAttributes)
Description copied from interface:MParticleUserassign attributes to the User in bulk- Specified by:
setUserAttributesin interfaceMParticleUser- Parameters:
userAttributes- the attributes to be set- Returns:
- whether the attributes were successfully set
-
getUserIdentities
public java.util.Map<MParticle.IdentityType,java.lang.String> getUserIdentities()
Description copied from interface:MParticleUserquery the Identities of the User- Specified by:
getUserIdentitiesin interfaceMParticleUser- Returns:
- the User's Identities
-
setUserAttribute
public boolean setUserAttribute(java.lang.String key, java.lang.Object value)Description copied from interface:MParticleUserset a single attribute for the user- Specified by:
setUserAttributein interfaceMParticleUser- Parameters:
key- the key of the attributevalue- the value of the attribute- Returns:
- whether the attributes were successfully set
-
setUserAttributeList
public boolean setUserAttributeList(java.lang.String key, java.lang.Object value)Description copied from interface:MParticleUserset a single attribute for the user whose value is an Object, not just a String- Specified by:
setUserAttributeListin interfaceMParticleUser- Parameters:
key- the key of the attributevalue- the value of the attribute- Returns:
- whether the attributes were successfully set
-
incrementUserAttribute
public boolean incrementUserAttribute(java.lang.String key, int value)Description copied from interface:MParticleUserincrement an attribute for the user- Specified by:
incrementUserAttributein interfaceMParticleUser- Parameters:
key- the key of the attributevalue- the value of the attribute- Returns:
- whether the attributes were successfully set
-
removeUserAttribute
public boolean removeUserAttribute(java.lang.String key)
Description copied from interface:MParticleUserremove an attribute for the user- Specified by:
removeUserAttributein interfaceMParticleUser- Parameters:
key- the key of the attribute which is to be removed- Returns:
- whether the attributes were successfully removed
-
setUserTag
public boolean setUserTag(@NonNull java.lang.String tag)Description copied from interface:MParticleUserset a tag for a User. A tag is represented by a key and a value of "null"- Specified by:
setUserTagin interfaceMParticleUser- Parameters:
tag- the tag to be set for the user- Returns:
- whether the tag was successfully set
-
getSegments
public void getSegments(long timeout, java.lang.String endpointId, SegmentListener listener)
-
getConsentState
public ConsentState getConsentState()
Description copied from interface:MParticleUserQuery the ConsentState of this user- Specified by:
getConsentStatein interfaceMParticleUser
-
setConsentState
public void setConsentState(ConsentState state)
Description copied from interface:MParticleUserSet the ConsentState for this user- Specified by:
setConsentStatein interfaceMParticleUser
-
isLoggedIn
public boolean isLoggedIn()
Description copied from interface:MParticleUserQuery the "Logged In" status for this user. A user is considered Logged In based on the presence of one or moreMParticle.IdentityType, such as IdentityType.CustomerId, defined by a workspace's IDSync strategy.- Specified by:
isLoggedInin interfaceMParticleUser- Returns:
- whether the user is "Logged In"
-
getFirstSeenTime
public long getFirstSeenTime()
Description copied from interface:MParticleUserThe timestamp representing the first time this user was observed on this device- Specified by:
getFirstSeenTimein interfaceMParticleUser- Returns:
-
getLastSeenTime
public long getLastSeenTime()
Description copied from interface:MParticleUserThe timestamp representing the last time this user was the "currentUser" on this device- Specified by:
getLastSeenTimein interfaceMParticleUser- Returns:
- the time, in milliseconds
-
-