Package com.mongodb
Class ReflectionDBObject
-
- com.mongodb.ReflectionDBObject
-
- All Implemented Interfaces:
DBObject
,BSONObject
public abstract class ReflectionDBObject extends implements DBObject
Deprecated.Replaced byPojoCodecProvider
This class enables to map simple Class fields to a BSON object fields
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReflectionDBObject.JavaWrapper
Deprecated.Represents a wrapper around the DBObject to interface with the Class fields
-
Constructor Summary
Constructors Constructor Description ReflectionDBObject()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
fieldName)
Deprecated.Checks if this object contains a field with the given name.boolean
key)
Deprecated.Deprecatedkey)
Deprecated.Gets a field from this object by a given name.get_id()
Deprecated.Gets the _idstatic ReflectionDBObject.JavaWrapper
c)
Deprecated.Returns an existing Wrapper instance associated with a class, or creates a new one.static ReflectionDBObject.JavaWrapper
c)
Deprecated.Returns the wrapper if this object can be assigned from this class.boolean
isPartialObject()
Deprecated.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' namesvoid
markAsPartialObject()
Deprecated.ReflectionDBObjects can't be partial.key, v)
Deprecated.Sets a name/value pair in this object.void
m)
Deprecated.Sets all key/value pairs from a map into this objectvoid
putAll(BSONObject o)
Deprecated.Sets all key/value pairs from an object into this objectkey)
Deprecated.This operation is not supported.void
id)
Deprecated.Sets the _idtoMap()
Deprecated.Returns a map representing this BSONObject.
-
-
-
Method Detail
-
get
@Nullable public get( key)
Deprecated.Description copied from interface:BSONObject
Gets a field from this object by a given name.- Specified by:
get
in interfaceBSONObject
- Parameters:
key
- The name of the field fetch- Returns:
- The field, if found
-
keySet
public <> keySet()
Deprecated.Description copied from interface:BSONObject
Returns this object's fields' names- Specified by:
keySet
in interfaceBSONObject
- Returns:
- The names of the fields in this object
-
containsKey
public boolean containsKey( key)
Deprecated.Description copied from interface:BSONObject
Deprecated- Specified by:
containsKey
in interfaceBSONObject
- Parameters:
key
- the key to check- Returns:
- True if the key is present
-
containsField
public boolean containsField( fieldName)
Deprecated.Description copied from interface:BSONObject
Checks if this object contains a field with the given name.- Specified by:
containsField
in interfaceBSONObject
- Parameters:
fieldName
- Field name for which to check- Returns:
- True if the field is present
-
put
public put( key, v)
Deprecated.Description copied from interface:BSONObject
Sets a name/value pair in this object.- Specified by:
put
in interfaceBSONObject
- Parameters:
key
- Name to setv
- Corresponding value- Returns:
- the previous value associated with
key
, ornull
if there was no mapping forkey
. (Anull
return can also indicate that the map previously associatednull
withkey
.)
-
putAll
public void putAll( m)
Deprecated.Description copied from interface:BSONObject
Sets all key/value pairs from a map into this object- Specified by:
putAll
in interfaceBSONObject
- Parameters:
m
- the map
-
putAll
public void putAll(BSONObject o)
Deprecated.Description copied from interface:BSONObject
Sets all key/value pairs from an object into this object- Specified by:
putAll
in interfaceBSONObject
- Parameters:
o
- the object
-
get_id
public get_id()
Deprecated.Gets the _id- Returns:
- the _id of this document
-
set_id
public void set_id( id)
Deprecated.Sets the _id- Parameters:
id
- the unique identifier for this DBObject
-
isPartialObject
public boolean isPartialObject()
Deprecated.Description copied from interface:DBObject
WhetherDBObject.markAsPartialObject()
was ever called only matters if you are going to upsert and do not want to risk losing fields.- Specified by:
isPartialObject
in interfaceDBObject
- Returns:
- true if this has been marked as a partial object
-
toMap
public toMap()
Deprecated.Description copied from interface:BSONObject
Returns a map representing this BSONObject.- Specified by:
toMap
in interfaceBSONObject
- Returns:
- the map
-
markAsPartialObject
public void markAsPartialObject()
Deprecated.ReflectionDBObjects can't be partial. This operation is not supported.- Specified by:
markAsPartialObject
in interfaceDBObject
- Throws:
- ReflectionDBObjects can't be partial
-
removeField
public removeField( key)
Deprecated.This operation is not supported.- Specified by:
removeField
in interfaceBSONObject
- Parameters:
key
- The name of the field to remove- Returns:
- The value removed from this object
- Throws:
- can't remove from a ReflectionDBObject
-
getWrapperIfReflectionObject
@Nullable public static c)
Deprecated.Returns the wrapper if this object can be assigned from this class.- Parameters:
c
- the class to be wrapped- Returns:
- the wrapper
-
getWrapper
public static c)
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
-
-