Package com.arcadedb.database
Class ImmutableDocument
- java.lang.Object
-
- com.arcadedb.database.BaseRecord
-
- com.arcadedb.database.BaseDocument
-
- com.arcadedb.database.ImmutableDocument
-
- All Implemented Interfaces:
Document
,Identifiable
,Record
,Externalizable
,Serializable
- Direct Known Subclasses:
DetachedDocument
,ImmutableEdge
,ImmutableEmbeddedDocument
,ImmutableLightEdge
,ImmutableVertex
public class ImmutableDocument extends BaseDocument
Immutable document implementation. To modify the record, you need to get the mutable representation by callingmodify()
. This implementation keeps the information in a byte[] to reduce the amount of objects to be managed by the Garbage Collector. For recurrent access to the record property you could evaluate to return the mutable version of it that is backed by an internal map where the record properties are cached in RAM.- Author:
- Luca Garulli
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.arcadedb.database.BaseDocument
propertiesStartingPosition, type
-
Fields inherited from class com.arcadedb.database.BaseRecord
buffer, database, rid
-
Fields inherited from interface com.arcadedb.database.Document
RECORD_TYPE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ImmutableDocument(Database graph, DocumentType type, RID rid, Binary buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkForLazyLoading()
Object
get(String propertyName)
Set<String>
getPropertyNames()
boolean
has(String propertyName)
MutableDocument
modify()
org.json.JSONObject
toJSON()
Map<String,Object>
toMap()
String
toString()
-
Methods inherited from class com.arcadedb.database.BaseDocument
asDocument, asDocument, detach, getBoolean, getByte, getDate, getDecimal, getDouble, getEmbedded, getFloat, getInteger, getLong, getRecordType, getShort, getString, getType, getTypeName, readExternal, reload, writeExternal
-
Methods inherited from class com.arcadedb.database.BaseRecord
asEdge, asEdge, asVertex, asVertex, delete, equals, getBuffer, getDatabase, getIdentity, getRecord, getRecord, hashCode, setBuffer
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.arcadedb.database.Identifiable
asEdge, asEdge, asVertex, asVertex, getRecord, getRecord
-
Methods inherited from interface com.arcadedb.database.Record
delete, getDatabase, getIdentity
-
-
-
-
Constructor Detail
-
ImmutableDocument
protected ImmutableDocument(Database graph, DocumentType type, RID rid, Binary buffer)
-
-
Method Detail
-
has
public boolean has(String propertyName)
-
modify
public MutableDocument modify()
-
toJSON
public org.json.JSONObject toJSON()
-
toString
public String toString()
- Overrides:
toString
in classBaseRecord
-
checkForLazyLoading
protected boolean checkForLazyLoading()
-
-