Package com.mongodb
Class ReflectionDBObject.JavaWrapper
-
- com.mongodb.ReflectionDBObject.JavaWrapper
-
- Enclosing class:
- ReflectionDBObject
public static class ReflectionDBObject.JavaWrapper extends
Represents a wrapper around the DBObject to interface with the Class fields
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
key)
Deprecated.get(ReflectionDBObject document, fieldName)
Gets the value for the given field from the given document.<>
keySet()
Gets all the fields on this object.set(ReflectionDBObject document, fieldName, value)
Adds or sets the given field to the given value on the document.
-
-
-
Method Detail
-
keySet
public <> keySet()
Gets all the fields on this object.- Returns:
- a Set of all the field names.
-
containsKey
public boolean containsKey( key)
Deprecated.Whether the document this represents contains the given field.- Parameters:
key
- a field name- Returns:
- true if the key exists
-
get
@Nullable public get(ReflectionDBObject document, fieldName)
Gets the value for the given field from the given document.- Parameters:
document
- a ReflectionDBObject representing a MongoDB documentfieldName
- the name of the field to get the value for- Returns:
- the value for the given field name
-
set
public set(ReflectionDBObject document, fieldName, value)
Adds or sets the given field to the given value on the document.- Parameters:
document
- a ReflectionDBObject representing a MongoDB documentfieldName
- the name of the field to get the value forvalue
- the value to set the field to- Returns:
- the result of setting this value
-
-