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:
  • Field Details

    • ADDITIONAL_RESULT_INFO_IN_CONTROL_GROUP

      public static final String ADDITIONAL_RESULT_INFO_IN_CONTROL_GROUP
      See Also:
  • Constructor Details

    • PersonalizationResult

      public PersonalizationResult()
    • PersonalizationResult

      public PersonalizationResult(List<String> contentIds)
  • Method Details

    • getContentIds

      public List<String> getContentIds()
      List of matching ids for current personalization
      Returns:
      the list of matching ids
    • setContentIds

      public void setContentIds(List<String> contentIds)
    • 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)