public class Profile extends Item implements SystemPropertiesItem
Contrary to other unomi Item
s, profiles are not part of a scope since we want to be able to track the associated user across applications. For this reason, data
collected for a given profile in a specific scope is still available to any scoped item that accesses the profile information.
It is interesting to note that there is not necessarily a one to one mapping between users and profiles as users can be captured across applications and different observation contexts. As identifying information might not be available in all contexts in which data is collected, resolving profiles to a single physical user can become complex because physical users are not observed directly. Rather, their portrait is progressively patched together and made clearer as unomi captures more and more traces of their actions. Unomi will merge related profiles as soon as collected data permits positive association between distinct profiles, usually as a result of the user performing some identifying action in a context where the user hadn’t already been positively identified.
Segment
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
ITEM_TYPE
The Profile ITEM_TYPE
|
Constructor and Description |
---|
Profile()
Instantiates a new Profile.
|
Profile(String profileId)
Instantiates a new Profile with the specified identifier.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Consent> |
getConsents()
Returns all the consents, including the revokes ones.
|
String |
getMergedWith()
Deprecated.
since 2.0.0 merge mechanism is now based on profile aliases, and this property is not used anymore
|
Object |
getNestedProperty(String name)
Retrieves the value of the nested property identified by the specified name.
|
Map<String,Object> |
getProperties()
Retrieves a Map of all property name - value pairs for this profile.
|
Object |
getProperty(String name)
Retrieves the property identified by the specified name.
|
String |
getScope()
Retrieves the Item's scope.
|
Map<String,Integer> |
getScores()
Retrieves the scores associated to this profile.
|
Set<String> |
getSegments()
Retrieves the identifiers of the segments this profile is a member of.
|
Map<String,Object> |
getSystemProperties()
Retrieves a Map of system property name - value pairs for this profile.
|
boolean |
isAnonymousProfile()
Returns true if this profile is an anonymous profile.
|
boolean |
setConsent(Consent consent)
Set a consent into the profile.
|
void |
setMergedWith(String mergedWith)
Deprecated.
since 2.0.0 merge mechanism is now based on profile aliases, and this property is not used anymore
|
void |
setProperties(Map<String,Object> properties)
Sets the property name - value pairs for this profile.
|
void |
setProperty(String name,
Object value)
Sets the property identified by the specified name to the specified value.
|
void |
setScores(Map<String,Integer> scores)
TODO: should be removed from the API
|
void |
setSegments(Set<String> segments)
Sets the identifiers of the segments this profile is a member of.
|
void |
setSystemProperties(Map<String,Object> systemProperties)
Specifies the system property name - value pairs for this profile.
|
Object |
setSystemProperty(String key,
Object value)
Sets a system property, overwriting an existing one if it existed.
|
String |
toString() |
equals, getItemId, getItemType, getItemType, getSystemMetadata, getVersion, hashCode, setItemId, setItemType, setScope, setSystemMetadata, setVersion
public static final String ITEM_TYPE
public Profile()
public Profile(String profileId)
profileId
- the profile identifierpublic void setProperty(String name, Object value)
name
- the name of the property to setvalue
- the value of the propertypublic Object getProperty(String name)
name
- the name of the property to retrievenull
if no such property existspublic Object getNestedProperty(String name)
name
- the name of the property to be retrieved, splited in the nested properties with "."public Map<String,Object> getProperties()
public void setProperties(Map<String,Object> properties)
properties
- a Map containing the property name - value pairs for this profilepublic Map<String,Object> getSystemProperties()
getSystemProperties
in interface SystemPropertiesItem
public void setSystemProperties(Map<String,Object> systemProperties)
systemProperties
- a Map of system property name - value pairs for this profilepublic Object setSystemProperty(String key, Object value)
key
- the key for the system property hash mapvalue
- the value for the system property hash mappublic String getScope()
Metadata.SYSTEM_SCOPE
).public Set<String> getSegments()
public void setSegments(Set<String> segments)
segments
- the segments@Deprecated public String getMergedWith()
@Deprecated public void setMergedWith(String mergedWith)
public Map<String,Integer> getScores()
Scoring
identifier - score pairspublic void setScores(Map<String,Integer> scores)
scores
- new value for scorespublic Map<String,Consent> getConsents()
public boolean isAnonymousProfile()
public boolean setConsent(Consent consent)
consent
- if the consent is REVOKED, it will try to remove a consent with the same type id if it
exists for the profile.Copyright © 2014–2023 Apache Software Foundation. All rights reserved.