Package lumis.portal.bigdata
Class Document
- java.lang.Object
-
- lumis.portal.bigdata.Document
-
- All Implemented Interfaces:
Serializable
,Map<String,Serializable>
- Direct Known Subclasses:
ActivityDocument
,MonitorUserDocument
,StandardDocument
@StableMinor(version="14.0", sinceVersion="8.1") public class Document extends Object implements Map<String,Serializable>, Serializable
Unit of searchable information. The searchable data is organized in form of aMap
. This object is used to be indexed by aindexer
and searched by asearcher
.- Since:
- 8.1.0
- Version:
- $Revision: 24477 $ $Date: 2021-04-28 11:30:36 -0300 (Wed, 28 Apr 2021) $
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Document(DocumentType documentType)
Constructs an empty instance ofDocument
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<String,Serializable>>
entrySet()
Serializable
get(Object key)
Serializable
get(DocumentTypeField field)
Returns the value stored in this document using the given field identifier as key.DocumentType
getDocumentType()
Returns thedocument type
of this document.String
getId()
Returns the identifier of this document.boolean
isEmpty()
Set<String>
keySet()
protected <T> T
newFieldValueProxy(DocumentTypeField field, Class<T> proxyInterface)
Creates a new proxy for a document root field value.Serializable
put(String key, Serializable value)
Serializable
put(DocumentTypeField field, Serializable... values)
Stores the given value in this document using the given field identifier as key.void
putAll(Map<? extends String,? extends Serializable> m)
Serializable
remove(Object key)
void
setId(String id)
Sets the identifier of this document.int
size()
Collection<Serializable>
values()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
Document
protected Document(DocumentType documentType)
Constructs an empty instance ofDocument
.- Parameters:
id
- the identifier of this document.documentType
- the document type of this document.- Throws:
IllegalArgumentException
- if the given identifier isnull
.IllegalArgumentException
- if the givenDocumentType
isnull
.- Since:
- 8.1.0
-
-
Method Detail
-
newFieldValueProxy
protected <T> T newFieldValueProxy(DocumentTypeField field, Class<T> proxyInterface)
Creates a new proxy for a document root field value.- Parameters:
field
- the field.proxyInterface
- the interface the proxy must implement.- Returns:
- the proxy.
- Since:
- 8.1.0
-
getDocumentType
public DocumentType getDocumentType()
Returns thedocument type
of this document.- Returns:
- the
document type
of this document. - Since:
- 8.1.0
-
getId
public String getId()
Returns the identifier of this document.- Returns:
- the identifier.
- Since:
- 11.0.0
-
setId
public void setId(String id)
Sets the identifier of this document.- Parameters:
id
- the identifier.- Since:
- 11.0.0
-
size
public int size()
- Specified by:
size
in interfaceMap<String,Serializable>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceMap<String,Serializable>
-
get
public Serializable get(Object key)
- Specified by:
get
in interfaceMap<String,Serializable>
-
get
public Serializable get(DocumentTypeField field)
Returns the value stored in this document using the given field identifier as key.- Parameters:
field
- the field.- Returns:
- the value stored in this document using the given field identifier as key.
- Since:
- 8.1.0
- See Also:
get(Object)
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<String,Serializable>
-
put
public Serializable put(String key, Serializable value)
- Specified by:
put
in interfaceMap<String,Serializable>
-
put
public Serializable put(DocumentTypeField field, Serializable... values)
Stores the given value in this document using the given field identifier as key.- Parameters:
field
- the field.value
- the value.- Returns:
- the previously stored value.
- Since:
- 8.1.0
- See Also:
put(String, Serializable)
-
putAll
public void putAll(Map<? extends String,? extends Serializable> m)
- Specified by:
putAll
in interfaceMap<String,Serializable>
-
remove
public Serializable remove(Object key)
- Specified by:
remove
in interfaceMap<String,Serializable>
-
clear
public void clear()
- Specified by:
clear
in interfaceMap<String,Serializable>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<String,Serializable>
-
values
public Collection<Serializable> values()
- Specified by:
values
in interfaceMap<String,Serializable>
-
entrySet
public Set<Map.Entry<String,Serializable>> entrySet()
- Specified by:
entrySet
in interfaceMap<String,Serializable>
-
-