Package org.bson
Class RawBsonDocument
- java.lang.Object
-
- org.bson.BsonValue
-
- org.bson.BsonDocument
-
- org.bson.RawBsonDocument
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,BsonValue>
,Bson
@Deprecated(since="2022-10-31") public final class RawBsonDocument extends BsonDocument
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.An immutable BSON document that is represented using only the raw bytes.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RawBsonDocument(byte[] bytes)
Deprecated.Constructs a new instance with the given byte array.RawBsonDocument(byte[] bytes, int offset, int length)
Deprecated.Constructs a new instance with the given byte array, offset, and length.RawBsonDocument(T document, Codec<T> codec)
Deprecated.Construct a new instance from the given document and codec for the document type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BsonDocument
append(java.lang.String key, BsonValue value)
Deprecated.Put the given key and value into this document, and return the document.void
clear()
Deprecated.BsonDocument
clone()
Deprecated.boolean
containsKey(java.lang.Object key)
Deprecated.boolean
containsValue(java.lang.Object value)
Deprecated.<T> T
decode(Codec<T> codec)
Deprecated.Decode this into a document.<T> T
decode(Decoder<T> decoder)
Deprecated.Decode this into a document.java.util.Set<java.util.Map.Entry<java.lang.String,BsonValue>>
entrySet()
Deprecated.boolean
equals(java.lang.Object o)
Deprecated.BsonValue
get(java.lang.Object key)
Deprecated.ByteBuf
getByteBuffer()
Deprecated.Returns aByteBuf
that wraps the byte array, with the proper byte order.java.lang.String
getFirstKey()
Deprecated.Gets the first key in the document.int
hashCode()
Deprecated.boolean
isEmpty()
Deprecated.java.util.Set<java.lang.String>
keySet()
Deprecated.static RawBsonDocument
parse(java.lang.String json)
Deprecated.Parses a string in MongoDB Extended JSON format to aRawBsonDocument
BsonValue
put(java.lang.String key, BsonValue value)
Deprecated.void
putAll(java.util.Map<? extends java.lang.String,? extends BsonValue> m)
Deprecated.BsonValue
remove(java.lang.Object key)
Deprecated.int
size()
Deprecated.java.lang.String
toJson()
Deprecated.Gets a JSON representation of this document using theJsonMode.STRICT
output mode, and otherwise the default settings ofJsonWriterSettings.Builder
.java.lang.String
toJson(JsonWriterSettings settings)
Deprecated.Gets a JSON representation of this document using the givenJsonWriterSettings
.java.util.Collection<BsonValue>
values()
Deprecated.-
Methods inherited from class org.bson.BsonDocument
asBsonReader, get, getArray, getArray, getBinary, getBinary, getBoolean, getBoolean, getBsonType, getDateTime, getDateTime, getDecimal128, getDecimal128, getDocument, getDocument, getDouble, getDouble, getInt32, getInt32, getInt64, getInt64, getNumber, getNumber, getObjectId, getObjectId, getRegularExpression, getRegularExpression, getString, getString, getTimestamp, getTimestamp, isArray, isBinary, isBoolean, isDateTime, isDecimal128, isDocument, isDouble, isInt32, isInt64, isNull, isNumber, isObjectId, isString, isTimestamp, toBsonDocument, toString
-
Methods inherited from class org.bson.BsonValue
asArray, asBinary, asBoolean, asDateTime, asDBPointer, asDecimal128, asDocument, asDouble, asInt32, asInt64, asJavaScript, asJavaScriptWithScope, asNumber, asObjectId, asRegularExpression, asString, asSymbol, asTimestamp, isArray, isBinary, isBoolean, isDateTime, isDBPointer, isDecimal128, isDocument, isDouble, isInt32, isInt64, isJavaScript, isJavaScriptWithScope, isNull, isNumber, isObjectId, isRegularExpression, isString, isSymbol, isTimestamp
-
-
-
-
Constructor Detail
-
RawBsonDocument
public RawBsonDocument(byte[] bytes)
Deprecated.Constructs a new instance with the given byte array. Note that it does not make a copy of the array, so do not modify it after passing it to this constructor.- Parameters:
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.
-
RawBsonDocument
public RawBsonDocument(byte[] bytes, int offset, int length)
Deprecated.Constructs a new instance with the given byte array, offset, and length. Note that it does not make a copy of the array, so do not modify it after passing it to this constructor.- Parameters:
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 use- Since:
- 3.3
-
RawBsonDocument
public RawBsonDocument(T document, Codec<T> codec)
Deprecated.Construct a new instance from the given document and codec for the document type.- Type Parameters:
T
- the BSON type that the codec encodes/decodes- Parameters:
document
- the document to transformcodec
- the codec to facilitate the transformation
-
-
Method Detail
-
parse
public static RawBsonDocument parse(java.lang.String json)
Deprecated.Parses a string in MongoDB Extended JSON format to aRawBsonDocument
- Parameters:
json
- the JSON string- Returns:
- a corresponding
RawBsonDocument
object - Since:
- 3.3
- See Also:
JsonReader
-
getByteBuffer
public ByteBuf getByteBuffer()
Deprecated.Returns aByteBuf
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.- Returns:
- a byte buffer that wraps the byte array owned by this instance.
-
decode
public <T> T decode(Codec<T> codec)
Deprecated.Decode this into a document.- Type Parameters:
T
- the BSON type that the codec encodes/decodes- Parameters:
codec
- the codec to facilitate the transformation- Returns:
- the decoded document
-
decode
public <T> T decode(Decoder<T> decoder)
Deprecated.Decode this into a document.- Type Parameters:
T
- the BSON type that the codec encodes/decodes- Parameters:
decoder
- the decoder to facilitate the transformation- Returns:
- the decoded document
- Since:
- 3.6
-
clear
public void clear()
Deprecated.- Specified by:
clear
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
clear
in classBsonDocument
-
put
public BsonValue put(java.lang.String key, BsonValue value)
Deprecated.- Specified by:
put
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
put
in classBsonDocument
-
append
public BsonDocument append(java.lang.String key, BsonValue value)
Deprecated.Description copied from class:BsonDocument
Put the given key and value into this document, and return the document.- Overrides:
append
in classBsonDocument
- Parameters:
key
- the keyvalue
- the value- Returns:
- this
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends BsonValue> m)
Deprecated.- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
putAll
in classBsonDocument
-
remove
public BsonValue remove(java.lang.Object key)
Deprecated.- Specified by:
remove
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
remove
in classBsonDocument
-
isEmpty
public boolean isEmpty()
Deprecated.- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
isEmpty
in classBsonDocument
-
size
public int size()
Deprecated.- Specified by:
size
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
size
in classBsonDocument
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,BsonValue>> entrySet()
Deprecated.- Specified by:
entrySet
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
entrySet
in classBsonDocument
-
values
public java.util.Collection<BsonValue> values()
Deprecated.- Specified by:
values
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
values
in classBsonDocument
-
keySet
public java.util.Set<java.lang.String> keySet()
Deprecated.- Specified by:
keySet
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
keySet
in classBsonDocument
-
getFirstKey
public java.lang.String getFirstKey()
Deprecated.Description copied from class:BsonDocument
Gets the first key in the document.- Overrides:
getFirstKey
in classBsonDocument
- Returns:
- the first key in the document
-
containsKey
public boolean containsKey(java.lang.Object key)
Deprecated.- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
containsKey
in classBsonDocument
-
containsValue
public boolean containsValue(java.lang.Object value)
Deprecated.- Specified by:
containsValue
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
containsValue
in classBsonDocument
-
get
public BsonValue get(java.lang.Object key)
Deprecated.- Specified by:
get
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
get
in classBsonDocument
-
toJson
public java.lang.String toJson()
Deprecated.Description copied from class:BsonDocument
Gets a JSON representation of this document using theJsonMode.STRICT
output mode, and otherwise the default settings ofJsonWriterSettings.Builder
.- Overrides:
toJson
in classBsonDocument
- Returns:
- a JSON representation of this document
- See Also:
BsonDocument.toJson(JsonWriterSettings)
,JsonWriterSettings
-
toJson
public java.lang.String toJson(JsonWriterSettings settings)
Deprecated.Description copied from class:BsonDocument
Gets a JSON representation of this document using the givenJsonWriterSettings
.- Overrides:
toJson
in classBsonDocument
- Parameters:
settings
- the JSON writer settings- Returns:
- a JSON representation of this document
-
equals
public boolean equals(java.lang.Object o)
Deprecated.- Specified by:
equals
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
equals
in classBsonDocument
-
hashCode
public int hashCode()
Deprecated.- Specified by:
hashCode
in interfacejava.util.Map<java.lang.String,BsonValue>
- Overrides:
hashCode
in classBsonDocument
-
clone
public BsonDocument clone()
Deprecated.- Overrides:
clone
in classBsonDocument
-
-