public class RawBsonDocument extends BsonDocument
| Constructor and Description |
|---|
RawBsonDocument(byte[] bytes)
Constructs a new instance with the given byte array.
|
RawBsonDocument(T document,
Codec<T> codec)
Construct a new instance from the given document and codec for the document type.
|
| Modifier and Type | Method and Description |
|---|---|
BsonDocument |
append(String key,
BsonValue value)
Put the given key and value into this document, and return the document.
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
<T> T |
decode(Codec<T> codec)
Decode this into a document.
|
Set<Map.Entry<String,BsonValue>> |
entrySet() |
boolean |
equals(Object o) |
BsonValue |
get(Object key) |
ByteBuf |
getByteBuffer()
Returns a
ByteBuf that wraps the byte array, with the proper byte order. |
int |
hashCode() |
boolean |
isEmpty() |
Set<String> |
keySet() |
BsonValue |
put(String key,
BsonValue value) |
void |
putAll(Map<? extends String,? extends BsonValue> m) |
BsonValue |
remove(Object key) |
int |
size() |
Collection<BsonValue> |
values() |
get, getArray, getArray, getBinary, getBinary, getBoolean, getBoolean, getBsonType, getDateTime, getDateTime, getDocument, getDocument, getDouble, getDouble, getInt32, getInt32, getInt64, getInt64, getNumber, getNumber, getObjectId, getObjectId, getRegularExpression, getRegularExpression, getString, getString, getTimestamp, getTimestamp, isArray, isBinary, isBoolean, isDateTime, isDocument, isDouble, isInt32, isInt64, isNull, isNumber, isObjectId, isString, isTimestamp, parse, toBsonDocument, toJson, toJson, toStringasArray, asBinary, asBoolean, asDateTime, asDBPointer, asDocument, asDouble, asInt32, asInt64, asJavaScript, asJavaScriptWithScope, asNumber, asObjectId, asRegularExpression, asString, asSymbol, asTimestamp, isArray, isBinary, isBoolean, isDateTime, isDBPointer, isDocument, isDouble, isInt32, isInt64, isJavaScript, isJavaScriptWithScope, isNull, isNumber, isObjectId, isRegularExpression, isString, isSymbol, isTimestampclone, finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic RawBsonDocument(byte[] bytes)
bytes - the bytes representing a BSON document. Note that the byte array is NOT copied, so care must be taken not to modify it
after passing it to this construction, unless of course that is your intention.public RawBsonDocument(T document,
Codec<T> codec)
T - the BSON type that the codec encodes/decodesdocument - the document to transformcodec - the codec to facilitate the transformationpublic ByteBuf getByteBuffer()
ByteBuf that wraps the byte array, with the proper byte order. Any changes made to the returned will be reflected
in the underlying byte array owned by this instance.public <T> T decode(Codec<T> codec)
T - the BSON type that the codec encodes/decodescodec - the codec to facilitate the transformationpublic void clear()
public BsonDocument append(String key, BsonValue value)
BsonDocumentappend in class BsonDocumentkey - the keyvalue - the valuepublic boolean isEmpty()
public int size()
public Collection<BsonValue> values()
public boolean containsKey(Object key)
containsKey in interface Map<String,BsonValue>containsKey in class BsonDocumentpublic boolean containsValue(Object value)
containsValue in interface Map<String,BsonValue>containsValue in class BsonDocumentpublic boolean equals(Object o)