Class IdentityMap


  • public class IdentityMap
    extends Object
    Defines a map containing a set of end user identities, keyed on either namespace integration code or the namespace ID of the identity. Within each namespace, the identity is unique. The values of the map are an array, meaning that more than one identity of each namespace may be carried.
    See Also:
    IdentityMap Schema
    • Constructor Detail

      • IdentityMap

        public IdentityMap()
    • Method Detail

      • getIdentityItemsForNamespace

        @NonNull
        public List<IdentityItem> getIdentityItemsForNamespace​(@NonNull
                                                               String namespace)
        Gets the IdentityItems for the namespace returns an empty list if no IdentityItems were found for the namespace
        Parameters:
        namespace - namespace for the list of identities to retrieve
        Returns:
        IdentityItem for the namespace
      • getNamespaces

        @NonNull
        public List<String> getNamespaces()
        Returns a list of all the namespaces contained in this IdentityMap.
        Returns:
        a list of all the namespaces for this IdentityMap, or an empty string if this IdentityMap is empty
      • addItem

        public void addItem​(@NonNull
                            IdentityItem item,
                            @NonNull
                            String namespace)
        Add an identity item which is used to clearly distinguish entities that are interacting with digital experiences. An IdentityItem with an empty id is not allowed and is ignored.
        Parameters:
        item - IdentityItem to be added to the given namespace; should not be null
        namespace - the namespace integration code or namespace ID of the identity; should not be null
      • removeItem

        public void removeItem​(@NonNull
                               IdentityItem item,
                               @NonNull
                               String namespace)
        Remove a single IdentityItem from this map.
        Parameters:
        item - IdentityItem to be removed from the given namespace; should not be null
        namespace - the namespace integration code or namespace ID of the identity; should not be null
      • isEmpty

        public boolean isEmpty()
        Determines if this IdentityMap has no identities.
        Returns:
        true if this IdentityMap contains no identifiers