|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,Object>
org.bson.BasicBSONObject
com.mongodb.BasicDBObject
public class BasicDBObject
A simple implementation of DBObject
.
A DBObject
can be created as follows, using this class:
DBObject obj = new BasicDBObject(); obj.put( "foo", "bar" );
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
BasicDBObject()
Creates an empty object. |
|
BasicDBObject(int size)
|
|
BasicDBObject(Map m)
Creates a DBObject from a map. |
|
BasicDBObject(String key,
Object value)
Convenience CTOR |
Method Summary | |
---|---|
BasicDBObject |
append(String key,
Object val)
Add a key/value pair to this object |
boolean |
isPartialObject()
Checks if this object is ready to be saved. |
void |
markAsPartialObject()
Sets that this object is incomplete and should not be saved. |
String |
toString()
Returns a JSON serialization of this object |
Methods inherited from class org.bson.BasicBSONObject |
---|
containsField, containsKey, equals, get, getBoolean, getDouble, getInt, getInt, getLong, getString, put, putAll, putAll, removeField, toMap |
Methods inherited from class java.util.LinkedHashMap |
---|
clear, containsValue, get, removeEldestEntry |
Methods inherited from class java.util.HashMap |
---|
clone, containsKey, entrySet, isEmpty, keySet, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.bson.BSONObject |
---|
containsField, containsKey, get, keySet, put, putAll, putAll, removeField, toMap |
Methods inherited from interface java.util.Map |
---|
containsKey, entrySet, hashCode, isEmpty, keySet, remove, size, values |
Constructor Detail |
---|
public BasicDBObject()
public BasicDBObject(int size)
public BasicDBObject(String key, Object value)
key
- key under which to storevalue
- value to storpublic BasicDBObject(Map m)
m
- map to convertMethod Detail |
---|
public boolean isPartialObject()
isPartialObject
in interface DBObject
public String toString()
toString
in class BasicBSONObject
public void markAsPartialObject()
markAsPartialObject
in interface DBObject
public BasicDBObject append(String key, Object val)
append
in class BasicBSONObject
key
- the field nameval
- the field value
val
parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |