Package com.mongodb
Class ReflectionDBObject
java.lang.Object
com.mongodb.ReflectionDBObject
- All Implemented Interfaces:
DBObject,BSONObject
Deprecated.
This class enables to map simple Class fields to a BSON object fields
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.Usage of this API is not supported in AEM as a Cloud Service. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsField(String fieldName) Deprecated.Checks if this object contains a field with the given name.booleancontainsKey(String key) Deprecated.DeprecatedDeprecated.Gets a field from this object by a given name.get_id()Deprecated.Gets the _idgetWrapper(Class c) Deprecated.Returns an existing Wrapper instance associated with a class, or creates a new one.Deprecated.Returns the wrapper if this object can be assigned from this class.booleanDeprecated.WhetherDBObject.markAsPartialObject()was ever called only matters if you are going to upsert and do not want to risk losing fields.keySet()Deprecated.Returns this object's fields' namesvoidDeprecated.ReflectionDBObjects can't be partial.Deprecated.Sets a name/value pair in this object.voidDeprecated.Sets all key/value pairs from a map into this objectvoidputAll(BSONObject o) Deprecated.Sets all key/value pairs from an object into this objectremoveField(String key) Deprecated.This operation is not supported.voidDeprecated.Sets the _idtoMap()Deprecated.Returns a map representing this BSONObject.
-
Constructor Details
-
ReflectionDBObject
public ReflectionDBObject()Deprecated.
-
-
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
-
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
-
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:
fieldName- Field name for which to check- Returns:
- True if the field is present
-
put
Deprecated.Description copied from interface:BSONObjectSets a name/value pair in this object.- Specified by:
putin interfaceBSONObject- Parameters:
key- Name to setv- Corresponding value- Returns:
- the previous value associated with
key, ornullif there was no mapping forkey. (Anullreturn can also indicate that the map previously associatednullwithkey.)
-
putAll
Deprecated.Description copied from interface:BSONObjectSets all key/value pairs from a map into this object- Specified by:
putAllin interfaceBSONObject- Parameters:
m- the map
-
putAll
Deprecated.Description copied from interface:BSONObjectSets all key/value pairs from an object into this object- Specified by:
putAllin interfaceBSONObject- Parameters:
o- the object
-
get_id
Deprecated.Gets the _id- Returns:
- the _id of this document
-
set_id
Deprecated.Sets the _id- Parameters:
id- the unique identifier for this DBObject
-
isPartialObject
public boolean isPartialObject()Deprecated.Description copied from interface:DBObjectWhetherDBObject.markAsPartialObject()was ever called only matters if you are going to upsert and do not want to risk losing fields.- Specified by:
isPartialObjectin interfaceDBObject- Returns:
- true if this has been marked as a partial object
-
toMap
Deprecated.Description copied from interface:BSONObjectReturns a map representing this BSONObject.- Specified by:
toMapin interfaceBSONObject- Returns:
- the map
-
markAsPartialObject
public void markAsPartialObject()Deprecated.ReflectionDBObjects can't be partial. This operation is not supported.- Specified by:
markAsPartialObjectin interfaceDBObject- Throws:
RuntimeException- ReflectionDBObjects can't be partial
-
removeField
Deprecated.This operation is not supported.- Specified by:
removeFieldin interfaceBSONObject- Parameters:
key- The name of the field to remove- Returns:
- The value removed from this object
- Throws:
UnsupportedOperationException- can't remove from a ReflectionDBObject
-
getWrapperIfReflectionObject
Deprecated.Returns the wrapper if this object can be assigned from this class.- Parameters:
c- the class to be wrapped- Returns:
- the wrapper
-
getWrapper
Deprecated.Returns an existing Wrapper instance associated with a class, or creates a new one.- Parameters:
c- the class to be wrapped- Returns:
- the wrapped
-
PojoCodecProvider