Class 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
      protected MParticleUserImpl()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ConsentState getConsentState()
      Query the ConsentState of this user
      long getFirstSeenTime()
      The timestamp representing the first time this user was observed on this device
      long getId()
      query the MPID of the User
      long getLastSeenTime()
      The timestamp representing the last time this user was the "currentUser" on this device
      void getSegments​(long timeout, java.lang.String endpointId, SegmentListener listener)  
      java.util.Map<java.lang.String,​java.lang.Object> getUserAttributes()
      query the attributes of the User
      java.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 User
      boolean incrementUserAttribute​(java.lang.String key, int value)
      increment an attribute for the user
      boolean isLoggedIn()
      Query the "Logged In" status for this user.
      boolean removeUserAttribute​(java.lang.String key)
      remove an attribute for the user
      void setConsentState​(ConsentState state)
      Set the ConsentState for this user
      boolean setUserAttribute​(java.lang.String key, java.lang.Object value)
      set a single attribute for the user
      boolean setUserAttributeList​(java.lang.String key, java.lang.Object value)
      set a single attribute for the user whose value is an Object, not just a String
      boolean setUserAttributes​(java.util.Map<java.lang.String,​java.lang.Object> userAttributes)
      assign attributes to the User in bulk
      boolean setUserTag​(java.lang.String tag)
      set a tag for a User.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MParticleUserImpl

        protected MParticleUserImpl()
    • Method Detail

      • getId

        public long getId()
        Description copied from interface: MParticleUser
        query the MPID of the User
        Specified by:
        getId in interface MParticleUser
        Returns:
        the mpid
      • getUserAttributes

        public java.util.Map<java.lang.String,​java.lang.Object> getUserAttributes()
        Description copied from interface: MParticleUser
        query the attributes of the User
        Specified by:
        getUserAttributes in interface MParticleUser
        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:
        getUserAttributes in interface MParticleUser
        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: MParticleUser
        assign attributes to the User in bulk
        Specified by:
        setUserAttributes in interface MParticleUser
        Parameters:
        userAttributes - the attributes to be set
        Returns:
        whether the attributes were successfully set
      • setUserAttribute

        public boolean setUserAttribute​(java.lang.String key,
                                        java.lang.Object value)
        Description copied from interface: MParticleUser
        set a single attribute for the user
        Specified by:
        setUserAttribute in interface MParticleUser
        Parameters:
        key - the key of the attribute
        value - 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: MParticleUser
        set a single attribute for the user whose value is an Object, not just a String
        Specified by:
        setUserAttributeList in interface MParticleUser
        Parameters:
        key - the key of the attribute
        value - 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: MParticleUser
        increment an attribute for the user
        Specified by:
        incrementUserAttribute in interface MParticleUser
        Parameters:
        key - the key of the attribute
        value - the value of the attribute
        Returns:
        whether the attributes were successfully set
      • removeUserAttribute

        public boolean removeUserAttribute​(java.lang.String key)
        Description copied from interface: MParticleUser
        remove an attribute for the user
        Specified by:
        removeUserAttribute in interface MParticleUser
        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: MParticleUser
        set a tag for a User. A tag is represented by a key and a value of "null"
        Specified by:
        setUserTag in interface MParticleUser
        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)
      • isLoggedIn

        public boolean isLoggedIn()
        Description copied from interface: MParticleUser
        Query the "Logged In" status for this user. A user is considered Logged In based on the presence of one or more MParticle.IdentityType, such as IdentityType.CustomerId, defined by a workspace's IDSync strategy.
        Specified by:
        isLoggedIn in interface MParticleUser
        Returns:
        whether the user is "Logged In"
      • getFirstSeenTime

        public long getFirstSeenTime()
        Description copied from interface: MParticleUser
        The timestamp representing the first time this user was observed on this device
        Specified by:
        getFirstSeenTime in interface MParticleUser
        Returns:
      • getLastSeenTime

        public long getLastSeenTime()
        Description copied from interface: MParticleUser
        The timestamp representing the last time this user was the "currentUser" on this device
        Specified by:
        getLastSeenTime in interface MParticleUser
        Returns:
        the time, in milliseconds