public interface BSONObject
Modifier and Type | Method and Description |
---|---|
boolean |
containsField(java.lang.String s)
Checks if this object contains a field with the given name.
|
boolean |
containsKey(java.lang.String key)
Deprecated.
Please use
containsField(String) instead |
java.lang.Object |
get(java.lang.String key)
Gets a field from this object by a given name.
|
java.util.Set<java.lang.String> |
keySet()
Returns this object's fields' names
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object v)
Sets a name/value pair in this object.
|
void |
putAll(BSONObject o)
Sets all key/value pairs from an object into this object
|
void |
putAll(java.util.Map m)
Sets all key/value pairs from a map into this object
|
java.lang.Object |
removeField(java.lang.String key)
Removes a field with a given name from this object.
|
java.util.Map |
toMap()
Returns a map representing this BSONObject.
|
java.lang.Object put(java.lang.String key, java.lang.Object v)
key
- Name to setv
- Corresponding valuevoid putAll(BSONObject o)
o
- the objectvoid putAll(java.util.Map m)
m
- the mapjava.lang.Object get(java.lang.String key)
key
- The name of the field fetchjava.util.Map toMap()
java.lang.Object removeField(java.lang.String key)
key
- The name of the field to remove@Deprecated boolean containsKey(java.lang.String key)
containsField(String)
insteadkey
- the key to checkboolean containsField(java.lang.String s)
s
- Field name for which to checkjava.util.Set<java.lang.String> keySet()