Interface MParticleUser

    • Method Detail

      • getId

        @NonNull
        long getId()
        query the MPID of the User
        Returns:
        the mpid
      • getUserAttributes

        @NonNull
        @WorkerThread
        java.util.Map<java.lang.String,​java.lang.Object> getUserAttributes()
        query the attributes of the User
        Returns:
        the User's attributes
      • getUserAttributes

        @Nullable
        java.util.Map<java.lang.String,​java.lang.Object> getUserAttributes​(@Nullable
                                                                                 UserAttributeListener listener)
        query the attributes of the User asynchronously
        Parameters:
        listener - a callback for querying User's attributes
        Returns:
      • setUserAttributes

        boolean setUserAttributes​(@NonNull
                                  java.util.Map<java.lang.String,​java.lang.Object> userAttributes)
        assign attributes to the User in bulk
        Parameters:
        userAttributes - the attributes to be set
        Returns:
        whether the attributes were successfully set
      • getUserIdentities

        @NonNull
        java.util.Map<MParticle.IdentityType,​java.lang.String> getUserIdentities()
        query the Identities of the User
        Returns:
        the User's Identities
      • setUserAttribute

        boolean setUserAttribute​(@NonNull
                                 java.lang.String key,
                                 @NonNull
                                 java.lang.Object value)
        set a single attribute for the user
        Parameters:
        key - the key of the attribute
        value - the value of the attribute
        Returns:
        whether the attributes were successfully set
      • setUserAttributeList

        boolean setUserAttributeList​(@NonNull
                                     java.lang.String key,
                                     @NonNull
                                     java.lang.Object value)
        set a single attribute for the user whose value is an Object, not just a String
        Parameters:
        key - the key of the attribute
        value - the value of the attribute
        Returns:
        whether the attributes were successfully set
      • incrementUserAttribute

        boolean incrementUserAttribute​(@NonNull
                                       java.lang.String key,
                                       int value)
        increment an attribute for the user
        Parameters:
        key - the key of the attribute
        value - the value of the attribute
        Returns:
        whether the attributes were successfully set
      • removeUserAttribute

        boolean removeUserAttribute​(@NonNull
                                    java.lang.String key)
        remove an attribute for the user
        Parameters:
        key - the key of the attribute which is to be removed
        Returns:
        whether the attributes were successfully removed
      • setUserTag

        boolean setUserTag​(@NonNull
                           java.lang.String tag)
        set a tag for a User. A tag is represented by a key and a value of "null"
        Parameters:
        tag - the tag to be set for the user
        Returns:
        whether the tag was successfully set
      • getConsentState

        @NonNull
        ConsentState getConsentState()
        Query the ConsentState of this user
      • setConsentState

        void setConsentState​(@Nullable
                             ConsentState state)
        Set the ConsentState for this user
      • isLoggedIn

        boolean isLoggedIn()
        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.
        Returns:
        whether the user is "Logged In"
      • getFirstSeenTime

        long getFirstSeenTime()
        The timestamp representing the first time this user was observed on this device
        Returns:
      • getLastSeenTime

        long getLastSeenTime()
        The timestamp representing the last time this user was the "currentUser" on this device
        Returns:
        the time, in milliseconds