public class LazyBSONObject extends Object implements BSONObject
| Modifier and Type | Class and Description |
|---|---|
class |
LazyBSONObject.LazyBSONKeySet
Deprecated.
This class is NOT a part of public API and will be dropped in 3.x versions.
|
| Modifier and Type | Field and Description |
|---|---|
protected LazyBSONCallback |
_callback
Deprecated.
This field is NOT a part of public API and will be dropped in 3.x versions.
|
protected int |
_doc_start_offset
Deprecated.
Please use
getOffset() instead. |
protected BSONByteBuffer |
_input
Deprecated.
Please use
getBytes() to access underlying bytes. |
| Constructor and Description |
|---|
LazyBSONObject(BSONByteBuffer buffer,
int offset,
LazyBSONCallback callback) |
LazyBSONObject(BSONByteBuffer buffer,
LazyBSONCallback callback) |
LazyBSONObject(byte[] data,
int offset,
LazyBSONCallback callback) |
LazyBSONObject(byte[] data,
LazyBSONCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsField(String s)
Checks if this object contains a field with the given name.
|
boolean |
containsKey(String s)
Deprecated.
|
Set<Map.Entry<String,Object>> |
entrySet()
This method will be more efficient than using a combination of keySet() and get(String key)
|
boolean |
equals(Object o) |
Object |
get(String key)
Gets a field from this object by a given name.
|
int |
getBSONSize() |
protected byte[] |
getBytes() |
protected int |
getElementBSONSize(int offset)
Deprecated.
This method is NOT a part of public API and will be dropped in 3.x versions.
|
protected byte |
getElementType(int offset)
Deprecated.
This method is NOT a part of public API and will be dropped in 3.x versions.
|
protected Object |
getElementValue(org.bson.LazyBSONObject.ElementRecord record)
Deprecated.
This method is NOT a part of public API and will be dropped in 3.x versions.
|
protected int |
getOffset() |
int |
hashCode() |
protected boolean |
isElementEmpty(int offset)
Deprecated.
This method is NOT a part of public API and will be dropped in 3.x versions.
|
boolean |
isEmpty() |
Set<String> |
keySet()
Returns this object's fields' names
|
int |
pipe(OutputStream os) |
Object |
put(String key,
Object v)
Sets a name/value pair in this object.
|
void |
putAll(BSONObject o)
Sets all key/value pairs from an object into this object
|
void |
putAll(Map m)
Sets all key/value pairs from a map into this object
|
Object |
removeField(String key)
Removes a field with a given name from this object.
|
protected int |
sizeCString(int offset)
Deprecated.
This method is NOT a part of public API and will be dropped in 3.x versions.
|
Map |
toMap()
Returns a map representing this BSONObject.
|
String |
toString()
Returns a JSON serialization of this object
|
@Deprecated protected final int _doc_start_offset
getOffset() instead.@Deprecated protected final BSONByteBuffer _input
getBytes() to access underlying bytes.@Deprecated protected final LazyBSONCallback _callback
public LazyBSONObject(byte[] data,
LazyBSONCallback callback)
public LazyBSONObject(byte[] data,
int offset,
LazyBSONCallback callback)
public LazyBSONObject(BSONByteBuffer buffer, LazyBSONCallback callback)
public LazyBSONObject(BSONByteBuffer buffer, int offset, LazyBSONCallback callback)
public Object put(String key, Object v)
BSONObjectput in interface BSONObjectkey - Name to setv - Corresponding valuepublic void putAll(BSONObject o)
BSONObjectputAll in interface BSONObjecto - the objectpublic void putAll(Map m)
BSONObjectputAll in interface BSONObjectm - the mappublic Object get(String key)
BSONObjectget in interface BSONObjectkey - The name of the field fetchpublic Map toMap()
BSONObjecttoMap in interface BSONObjectpublic Object removeField(String key)
BSONObjectremoveField in interface BSONObjectkey - The name of the field to remove@Deprecated public boolean containsKey(String s)
BSONObjectcontainsKey in interface BSONObjectpublic boolean containsField(String s)
BSONObjectcontainsField in interface BSONObjects - Field name for which to checkpublic Set<String> keySet()
BSONObjectkeySet in interface BSONObjectpublic Set<Map.Entry<String,Object>> entrySet()
@Deprecated protected boolean isElementEmpty(int offset)
public boolean isEmpty()
public int getBSONSize()
public int pipe(OutputStream os) throws IOException
IOException@Deprecated protected byte getElementType(int offset)
@Deprecated protected int getElementBSONSize(int offset)
@Deprecated protected int sizeCString(int offset)
offset - the offset into the buffer@Deprecated protected Object getElementValue(org.bson.LazyBSONObject.ElementRecord record)
protected int getOffset()
protected byte[] getBytes()