Package org.apache.unomi.api
Class PersonalizationResult
- java.lang.Object
-
- org.apache.unomi.api.PersonalizationResult
-
- All Implemented Interfaces:
Serializable
public class PersonalizationResult extends Object implements 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ADDITIONAL_RESULT_INFO_IN_CONTROL_GROUP
-
Constructor Summary
Constructors Constructor Description PersonalizationResult()
PersonalizationResult(List<String> contentIds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChanges(int changes)
Map<String,Object>
getAdditionalResultInfos()
Useful open map to return additional result information to the clientint
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.List<String>
getContentIds()
List of matching ids for current personalizationboolean
isInControlGroup()
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 Detail
-
ADDITIONAL_RESULT_INFO_IN_CONTROL_GROUP
public static final String ADDITIONAL_RESULT_INFO_IN_CONTROL_GROUP
- See Also:
- Constant Field Values
-
-
Method Detail
-
getContentIds
public List<String> getContentIds()
List of matching ids for current personalization- Returns:
- the list of matching ids
-
getAdditionalResultInfos
public Map<String,Object> getAdditionalResultInfos()
Useful open map to return additional result information to the client- Returns:
- map of key/value pair for additional information, like: inControlGroup
-
setAdditionalResultInfos
public void setAdditionalResultInfos(Map<String,Object> additionalResultInfos)
-
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)
-
-