Package com.mongodb
Class LazyDBObject
java.lang.Object
org.bson.LazyBSONObject
com.mongodb.LazyDBObject
- All Implemented Interfaces:
DBObject
,BSONObject
An immutable
DBObject
backed by a byte buffer that lazily provides keys and values on request. This is useful for transferring
BSON documents between servers when you don't want to pay the performance penalty of encoding or decoding them fully.-
Constructor Summary
ConstructorDescriptionLazyDBObject
(byte[] bytes, int offset, LazyBSONCallback callback) Construct an instance.LazyDBObject
(byte[] bytes, LazyBSONCallback callback) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
toString()
Returns a JSON serialization of this objectMethods inherited from class org.bson.LazyBSONObject
containsField, entrySet, equals, get, getBSONSize, getBytes, getOffset, hashCode, isEmpty, keySet, pipe, put, putAll, putAll, removeField, toMap
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.bson.BSONObject
containsField, get, keySet, put, putAll, putAll, removeField, toMap
-
Constructor Details
-
LazyDBObject
Construct an instance.- Parameters:
bytes
- the raw bytescallback
- the callback to use to construct nested values
-
LazyDBObject
Construct an instance.- Parameters:
bytes
- the raw bytesoffset
- the offset into the raw bytescallback
- the callback to use to construct nested values
-
-
Method Details
-
markAsPartialObject
public void markAsPartialObject()- Specified by:
markAsPartialObject
in interfaceDBObject
-
isPartialObject
public boolean isPartialObject()- Specified by:
isPartialObject
in interfaceDBObject
-
toString
Returns a JSON serialization of this object
-