Class SuggestionContext
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- org.nuxeo.ecm.platform.suggestbox.service.SuggestionContext
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,Object>
public class SuggestionContext extends HashMap<String,Object>
Base class and default implementation for passing contextual information to the suggestion service. This is primarily a hash map to store arbitrary context element that might be useful for suggester along with a few mandatory and common optional attributes for direct access.- Author:
- ogrisel
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description DocumentModel
currentDocument
Locale
locale
Map<String,String>
messages
Principal
principal
CoreSession
session
String
suggesterGroup
-
Constructor Summary
Constructors Constructor Description SuggestionContext(String suggesterGroup, Principal principal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SuggestionContext
withCurrentDocument(DocumentModel currentDocument)
SuggestionContext
withLocale(Locale locale)
SuggestionContext
withMessages(Map<String,String> messages)
SuggestionContext
withSession(CoreSession session)
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Field Detail
-
suggesterGroup
public final String suggesterGroup
-
session
public transient CoreSession session
-
currentDocument
public DocumentModel currentDocument
-
-
Constructor Detail
-
SuggestionContext
public SuggestionContext(String suggesterGroup, Principal principal) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-
Method Detail
-
withSession
public SuggestionContext withSession(CoreSession session)
-
withCurrentDocument
public SuggestionContext withCurrentDocument(DocumentModel currentDocument)
-
withLocale
public SuggestionContext withLocale(Locale locale)
-
withMessages
public SuggestionContext withMessages(Map<String,String> messages)
-
-