public final class RawBsonDocument extends BsonDocument
| 构造器和说明 |
|---|
RawBsonDocument(byte[] bytes)
Constructs a new instance with the given byte array.
|
RawBsonDocument(byte[] bytes,
int offset,
int length)
Constructs a new instance with the given byte array, offset, and length.
|
RawBsonDocument(T document,
Codec<T> codec)
Construct a new instance from the given document and codec for the document type.
|
| 限定符和类型 | 方法和说明 |
|---|---|
BsonDocument |
append(java.lang.String key,
BsonValue value)
Put the given key and value into this document, and return the document.
|
void |
clear() |
BsonDocument |
clone() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
<T> T |
decode(Codec<T> codec)
Decode this into a document.
|
java.util.Set<java.util.Map.Entry<java.lang.String,BsonValue>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
BsonValue |
get(java.lang.Object key) |
ByteBuf |
getByteBuffer()
Returns a
ByteBuf that wraps the byte array, with the proper byte order. |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
static RawBsonDocument |
parse(java.lang.String json)
Parses a string in MongoDB Extended JSON format to a
RawBsonDocument |
BsonValue |
put(java.lang.String key,
BsonValue value) |
void |
putAll(java.util.Map<? extends java.lang.String,? extends BsonValue> m) |
BsonValue |
remove(java.lang.Object key) |
int |
size() |
java.lang.String |
toJson()
Gets a JSON representation of this document using the default settings of
JsonWriterSettings. |
java.lang.String |
toJson(JsonWriterSettings settings)
Gets a JSON representation of this document using the given
JsonWriterSettings. |
java.util.Collection<BsonValue> |
values() |
get, getArray, getArray, getBinary, getBinary, getBoolean, getBoolean, getBsonType, getBytes, 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, setBytes, toBsonDocument, 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, isTimestamppublic 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(byte[] bytes,
int offset,
int length)
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.offset - the offset into the byte arraylength - the length of the subarray to usepublic 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 static RawBsonDocument parse(java.lang.String json)
RawBsonDocumentjson - the JSON stringRawBsonDocument objectJsonReaderpublic 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()
clear 在接口中 java.util.Map<java.lang.String,BsonValue>clear 在类中 BsonDocumentpublic BsonValue put(java.lang.String key, BsonValue value)
put 在接口中 java.util.Map<java.lang.String,BsonValue>put 在类中 BsonDocumentpublic BsonDocument append(java.lang.String key, BsonValue value)
BsonDocumentappend 在类中 BsonDocumentkey - the keyvalue - the valuepublic void putAll(java.util.Map<? extends java.lang.String,? extends BsonValue> m)
putAll 在接口中 java.util.Map<java.lang.String,BsonValue>putAll 在类中 BsonDocumentpublic BsonValue remove(java.lang.Object key)
remove 在接口中 java.util.Map<java.lang.String,BsonValue>remove 在类中 BsonDocumentpublic boolean isEmpty()
isEmpty 在接口中 java.util.Map<java.lang.String,BsonValue>isEmpty 在类中 BsonDocumentpublic int size()
size 在接口中 java.util.Map<java.lang.String,BsonValue>size 在类中 BsonDocumentpublic java.util.Set<java.util.Map.Entry<java.lang.String,BsonValue>> entrySet()
entrySet 在接口中 java.util.Map<java.lang.String,BsonValue>entrySet 在类中 BsonDocumentpublic java.util.Collection<BsonValue> values()
values 在接口中 java.util.Map<java.lang.String,BsonValue>values 在类中 BsonDocumentpublic java.util.Set<java.lang.String> keySet()
keySet 在接口中 java.util.Map<java.lang.String,BsonValue>keySet 在类中 BsonDocumentpublic boolean containsKey(java.lang.Object key)
containsKey 在接口中 java.util.Map<java.lang.String,BsonValue>containsKey 在类中 BsonDocumentpublic boolean containsValue(java.lang.Object value)
containsValue 在接口中 java.util.Map<java.lang.String,BsonValue>containsValue 在类中 BsonDocumentpublic BsonValue get(java.lang.Object key)
get 在接口中 java.util.Map<java.lang.String,BsonValue>get 在类中 BsonDocumentpublic java.lang.String toJson()
BsonDocumentJsonWriterSettings.toJson 在类中 BsonDocumentJsonWriterSettingspublic java.lang.String toJson(JsonWriterSettings settings)
BsonDocumentJsonWriterSettings.toJson 在类中 BsonDocumentsettings - the JSON writer settingspublic boolean equals(java.lang.Object o)
equals 在接口中 java.util.Map<java.lang.String,BsonValue>equals 在类中 BsonDocumentpublic int hashCode()
hashCode 在接口中 java.util.Map<java.lang.String,BsonValue>hashCode 在类中 BsonDocumentpublic BsonDocument clone()
clone 在类中 BsonDocument