java.lang.Object | ||||
↳ | java.util.AbstractMap<K, V> | |||
↳ | java.util.HashMap<K, V> | |||
↳ | java.util.LinkedHashMap<K, V> | |||
↳ | org.bson.BasicBSONObject |
Known Direct Subclasses |
Known Indirect Subclasses |
A simple implementation of DBObject
.
A DBObject
can be created as follows, using this class:
DBObject obj = new BasicBSONObject(); obj.put( "foo", "bar" );
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty object.
| |||||||||||
Convenience CTOR
| |||||||||||
Creates a DBObject from a map.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a key/value pair to this object
| |||||||||||
Checks if this object contains a given field
| |||||||||||
This method is deprecated.
No replacement.
| |||||||||||
Gets a value from this object
| |||||||||||
Returns the value of a field as a boolean
| |||||||||||
Returns the value of a field as a boolean.
| |||||||||||
Returns the date or def if not set.
| |||||||||||
Returns the date or null if not set.
| |||||||||||
Returns the value of a field as an
double . | |||||||||||
Returns the value of a field as a
double . | |||||||||||
Returns the value of a field as an
int . | |||||||||||
Returns the value of a field as an
int . | |||||||||||
Returns the value of a field as an
long . | |||||||||||
Returns the value of a field as a
long . | |||||||||||
Returns the object id or null if not set.
| |||||||||||
Returns the object id or def if not set.
| |||||||||||
Returns the value of a field as a string
| |||||||||||
Returns the value of a field as a string
| |||||||||||
Add a key/value pair to this object
| |||||||||||
Sets all key/value pairs from an object into this object
| |||||||||||
Deletes a field from this object.
| |||||||||||
Converts a DBObject to a map.
| |||||||||||
Returns a JSON serialization of this object
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.util.LinkedHashMap
| |||||||||||
From class
java.util.HashMap
| |||||||||||
From class
java.util.AbstractMap
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.util.Map
| |||||||||||
From interface
org.bson.BSONObject
|
Creates an empty object.
Convenience CTOR
key | key under which to store |
---|---|
value | value to stor |
Add a key/value pair to this object
key | the field name |
---|---|
val | the field value |
this
Checks if this object contains a given field
field | field name |
---|
This method is deprecated.
No replacement.
Deprecated
Gets a value from this object
key | field name |
---|
Returns the value of a field as a boolean
key | the field to look up |
---|---|
def | the default value in case the field is not found |
Returns the value of a field as a boolean.
key | the field to look up |
---|
Returns the date or def if not set.
field | The field to return |
---|---|
def | the default value in case the field is not found |
Returns the date or null if not set.
field | The field to return |
---|
Returns the value of a field as an double
.
key | the field to look for |
---|---|
def | the default to return |
Returns the value of a field as a double
.
key | the field to return |
---|
Returns the value of a field as an int
.
key | the field to look for |
---|
Returns the value of a field as an int
.
key | the field to look for |
---|---|
def | the default to return |
Returns the value of a field as an long
.
key | the field to look for |
---|---|
def | the default to return |
Returns the value of a field as a long
.
key | the field to return |
---|
Returns the object id or null if not set.
field | The field to return |
---|
Returns the object id or def if not set.
field | The field to return |
---|---|
def | the default value in case the field is not found |
Returns the value of a field as a string
key | the field to look up |
---|---|
def | the default to return |
Returns the value of a field as a string
key | the field to look up |
---|
Add a key/value pair to this object
key | the field name |
---|---|
val | the field value |
val
parameter
Sets all key/value pairs from an object into this object
o | the object |
---|
Deletes a field from this object.
key | the field name to remove |
---|