Package org.apache.unomi.api
Class PersonalizationResult
java.lang.Object
org.apache.unomi.api.PersonalizationResult
- All Implemented Interfaces:
Serializable
A class to contain the result of a personalization, containing the list of content IDs as well as a changeType to
indicate if a profile and/or a session was modified.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChanges
(int changes) Useful open map to return additional result information to the clientint
Change code in case the personalization resolution modified the profile or the session Only used internally, and will not be serialized either for storage or response payload.List of matching ids for current personalizationboolean
Is the current personalization result in a control group ?void
setAdditionalResultInfos
(Map<String, Object> additionalResultInfos) void
setContentIds
(List<String> contentIds) void
setInControlGroup
(boolean inControlGroup)
-
Field Details
-
ADDITIONAL_RESULT_INFO_IN_CONTROL_GROUP
- See Also:
-
-
Constructor Details
-
PersonalizationResult
public PersonalizationResult() -
PersonalizationResult
-
-
Method Details
-
getContentIds
List of matching ids for current personalization- Returns:
- the list of matching ids
-
setContentIds
-
getAdditionalResultInfos
Useful open map to return additional result information to the client- Returns:
- map of key/value pair for additional information, like: inControlGroup
-
setAdditionalResultInfos
-
isInControlGroup
public boolean isInControlGroup()Is the current personalization result in a control group ? Control group are used to identify a profile or a session that should not get personalized results, instead the current profile/session should get a specific result (usually the same for all peoples falling in control group) Note: it's for now the responsibility of the client to decide what to do when the current personalization is under control group.- Returns:
- true in case current profile or session is in control group for the personalization.
-
setInControlGroup
public void setInControlGroup(boolean inControlGroup) -
getChangeType
public int getChangeType()Change code in case the personalization resolution modified the profile or the session Only used internally, and will not be serialized either for storage or response payload.- Returns:
- change code
-
addChanges
public void addChanges(int changes)
-