public class LazyBSONObject extends java.lang.Object implements BSONObject
BSONObject 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.| 构造器和说明 |
|---|
LazyBSONObject(byte[] bytes,
int offset,
LazyBSONCallback callback)
Construct an instance.
|
LazyBSONObject(byte[] bytes,
LazyBSONCallback callback)
Construct an instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
containsField(java.lang.String s)
Checks if this object contains a field with the given name.
|
boolean |
containsKey(java.lang.String key)
已过时。
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet()
Gets the entry set for all the key/value pairs in this
BSONObject. |
boolean |
equals(java.lang.Object o) |
java.lang.Object |
get(java.lang.String key)
Gets a field from this object by a given name.
|
int |
getBSONSize()
Gets the size in bytes of the BSON document.
|
protected byte[] |
getBytes()
Gets the raw bytes.
|
protected int |
getOffset()
Gets the offset into the raw bytes representing the start of the document
|
int |
hashCode() |
boolean |
isEmpty()
Gets whether this is an empty
BSONObject. |
java.util.Set<java.lang.String> |
keySet()
Returns this object's fields' names
|
int |
pipe(java.io.OutputStream os)
Pipe the raw bytes into the given output stream.
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object v)
Always throws
UnsupportedOperationException. |
void |
putAll(BSONObject o)
Always throws
UnsupportedOperationException. |
void |
putAll(java.util.Map m)
Always throws
UnsupportedOperationException. |
java.lang.Object |
removeField(java.lang.String key)
Always throws
UnsupportedOperationException. |
java.util.Map |
toMap()
Returns a map representing this BSONObject.
|
java.lang.String |
toString()
Returns a JSON serialization of this object
|
public LazyBSONObject(byte[] bytes,
LazyBSONCallback callback)
bytes - the raw bytescallback - the callback to use to construct nested valuespublic LazyBSONObject(byte[] bytes,
int offset,
LazyBSONCallback callback)
bytes - the raw bytesoffset - the offset into the raw bytes representing the start of the documentcallback - the callback to use to construct nested valuesprotected int getOffset()
protected byte[] getBytes()
public java.lang.Object get(java.lang.String key)
BSONObjectget 在接口中 BSONObjectkey - The name of the field fetch@Deprecated public boolean containsKey(java.lang.String key)
BSONObjectcontainsKey 在接口中 BSONObjectkey - the key to checkpublic boolean containsField(java.lang.String s)
BSONObjectcontainsField 在接口中 BSONObjects - Field name for which to checkpublic java.util.Set<java.lang.String> keySet()
BSONObjectkeySet 在接口中 BSONObjectpublic boolean isEmpty()
BSONObject.public int getBSONSize()
public int pipe(java.io.OutputStream os)
throws java.io.IOException
os - the output streamjava.io.IOException - any IOException thrown by the output streampublic java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
BSONObject.public int hashCode()
hashCode 在类中 java.lang.Objectpublic boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic java.lang.String toString()
toString 在类中 java.lang.Objectpublic java.lang.Object put(java.lang.String key,
java.lang.Object v)
UnsupportedOperationException.put 在接口中 BSONObjectkey - Name to setv - Corresponding valuejava.lang.UnsupportedOperationException - the object is read onlypublic void putAll(BSONObject o)
UnsupportedOperationException.putAll 在接口中 BSONObjecto - the objectjava.lang.UnsupportedOperationException - the object is read onlypublic void putAll(java.util.Map m)
UnsupportedOperationException.putAll 在接口中 BSONObjectm - the mapjava.lang.UnsupportedOperationException - the object is read onlypublic java.lang.Object removeField(java.lang.String key)
UnsupportedOperationException.removeField 在接口中 BSONObjectkey - The name of the field to removejava.lang.UnsupportedOperationException - the object is read onlypublic java.util.Map toMap()
BSONObjecttoMap 在接口中 BSONObject