Package org.bson
Class LazyBSONObject
java.lang.Object
org.bson.LazyBSONObject
- All Implemented Interfaces:
BSONObject
- Direct Known Subclasses:
LazyBSONList,LazyDBObject
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
An immutable
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.-
Constructor Summary
ConstructorsConstructorDescriptionLazyBSONObject(byte[] bytes, int offset, LazyBSONCallback callback) Deprecated.Construct an instance.LazyBSONObject(byte[] bytes, LazyBSONCallback callback) Deprecated.Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Checks if this object contains a field with the given name.booleancontainsKey(String key) Deprecated.entrySet()Deprecated.Gets the entry set for all the key/value pairs in thisBSONObject.booleanDeprecated.Deprecated.Gets a field from this object by a given name.intDeprecated.Gets the size in bytes of the BSON document.inthashCode()Deprecated.booleanisEmpty()Deprecated.Gets whether this is an emptyBSONObject.keySet()Deprecated.Returns this object's fields' namesintpipe(OutputStream os) Deprecated.Pipe the raw bytes into the given output stream.Deprecated.Always throwsUnsupportedOperationException.voidDeprecated.Always throwsUnsupportedOperationException.voidputAll(BSONObject o) Deprecated.Always throwsUnsupportedOperationException.removeField(String key) Deprecated.Always throwsUnsupportedOperationException.toMap()Deprecated.Returns a map representing this BSONObject.
-
Constructor Details
-
LazyBSONObject
Deprecated.Construct an instance.- Parameters:
bytes- the raw bytescallback- the callback to use to construct nested values
-
LazyBSONObject
Deprecated.Construct an instance.- Parameters:
bytes- the raw bytesoffset- the offset into the raw bytes representing the start of the documentcallback- the callback to use to construct nested values
-
-
Method Details
-
get
Deprecated.Description copied from interface:BSONObjectGets a field from this object by a given name.- Specified by:
getin interfaceBSONObject- Parameters:
key- The name of the field fetch- Returns:
- The field, if found
-
containsKey
Deprecated.Description copied from interface:BSONObjectDeprecated- Specified by:
containsKeyin interfaceBSONObject- Parameters:
key- the key to check- Returns:
- True if the key is present
-
containsField
Deprecated.Description copied from interface:BSONObjectChecks if this object contains a field with the given name.- Specified by:
containsFieldin interfaceBSONObject- Parameters:
s- Field name for which to check- Returns:
- True if the field is present
-
keySet
Deprecated.Description copied from interface:BSONObjectReturns this object's fields' names- Specified by:
keySetin interfaceBSONObject- Returns:
- The names of the fields in this object
-
isEmpty
public boolean isEmpty()Deprecated.Gets whether this is an emptyBSONObject.- Returns:
- true if this has no keys
-
getBSONSize
public int getBSONSize()Deprecated.Gets the size in bytes of the BSON document.- Returns:
- the size in bytes
-
pipe
Deprecated.Pipe the raw bytes into the given output stream.- Parameters:
os- the output stream- Returns:
- the number of bytes written
- Throws:
IOException- any IOException thrown by the output stream
-
entrySet
Deprecated.Gets the entry set for all the key/value pairs in thisBSONObject. The returned set is immutable.- Returns:
- then entry set
-
hashCode
public int hashCode()Deprecated. -
equals
Deprecated. -
put
Deprecated.Always throwsUnsupportedOperationException.- Specified by:
putin interfaceBSONObject- Parameters:
key- Name to setv- Corresponding value- Returns:
- will not return normally
- Throws:
UnsupportedOperationException- the object is read only
-
putAll
Deprecated.Always throwsUnsupportedOperationException.- Specified by:
putAllin interfaceBSONObject- Parameters:
o- the object- Throws:
UnsupportedOperationException- the object is read only
-
putAll
Deprecated.Always throwsUnsupportedOperationException.- Specified by:
putAllin interfaceBSONObject- Parameters:
m- the map- Throws:
UnsupportedOperationException- the object is read only
-
removeField
Deprecated.Always throwsUnsupportedOperationException.- Specified by:
removeFieldin interfaceBSONObject- Parameters:
key- The name of the field to remove- Returns:
- will not return normally
- Throws:
UnsupportedOperationException- the object is read only
-
toMap
Deprecated.Description copied from interface:BSONObjectReturns a map representing this BSONObject.- Specified by:
toMapin interfaceBSONObject- Returns:
- the map
-