@Immutable public class LazyDBObject extends LazyBSONObject implements DBObject
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 and Description |
---|
LazyDBObject(byte[] bytes,
int offset,
LazyBSONCallback callback)
Construct an instance.
|
LazyDBObject(byte[] bytes,
LazyBSONCallback callback)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isPartialObject()
Whether
DBObject.markAsPartialObject() was ever called only matters if you are going to upsert and do not want to risk losing fields. |
void |
markAsPartialObject()
If this object was retrieved with only some fields (using a field filter) this method will be called to mark it as such.
|
containsField, containsKey, entrySet, equals, get, getBSONSize, getBytes, getOffset, hashCode, isEmpty, keySet, pipe, put, putAll, putAll, removeField, toMap, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
containsField, containsKey, get, keySet, put, putAll, putAll, removeField, toMap
public LazyDBObject(byte[] bytes, LazyBSONCallback callback)
bytes
- the raw bytescallback
- the callback to use to construct nested valuespublic LazyDBObject(byte[] bytes, int offset, LazyBSONCallback callback)
bytes
- the raw bytesoffset
- the offset into the raw bytescallback
- the callback to use to construct nested valuespublic void markAsPartialObject()
DBObject
markAsPartialObject
in interface DBObject
public boolean isPartialObject()
DBObject
DBObject.markAsPartialObject()
was ever called only matters if you are going to upsert and do not want to risk losing fields.isPartialObject
in interface DBObject