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.AbstractMapAbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
 
- 
 - 
Field SummaryFields Modifier and Type Field Description DocumentModelcurrentDocumentLocalelocaleMap<String,String>messagesPrincipalprincipalCoreSessionsessionStringsuggesterGroup
 - 
Constructor SummaryConstructors Constructor Description SuggestionContext(String suggesterGroup, Principal principal)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description SuggestionContextwithCurrentDocument(DocumentModel currentDocument)SuggestionContextwithLocale(Locale locale)SuggestionContextwithMessages(Map<String,String> messages)SuggestionContextwithSession(CoreSession session)- 
Methods inherited from class java.util.HashMapclear, 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.AbstractMapequals, hashCode, toString
 
- 
 
- 
- 
- 
Field Detail- 
suggesterGrouppublic final String suggesterGroup 
 - 
principalpublic final Principal principal 
 - 
sessionpublic transient CoreSession session 
 - 
currentDocumentpublic DocumentModel currentDocument 
 - 
localepublic Locale locale 
 
- 
 - 
Constructor Detail- 
SuggestionContextpublic SuggestionContext(String suggesterGroup, Principal principal) throws IllegalArgumentException - Throws:
- IllegalArgumentException
 
 
- 
 - 
Method Detail- 
withSessionpublic SuggestionContext withSession(CoreSession session) 
 - 
withCurrentDocumentpublic SuggestionContext withCurrentDocument(DocumentModel currentDocument) 
 - 
withLocalepublic SuggestionContext withLocale(Locale locale) 
 - 
withMessagespublic SuggestionContext withMessages(Map<String,String> messages) 
 
- 
 
-