|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mongodb.BasicDBObjectBuilder
public class BasicDBObjectBuilder
utility for building complex objects example: BasicDBObjectBuilder.start().add( "name" , "eliot" ).add( "number" , 17 ).get()
Constructor Summary | |
---|---|
BasicDBObjectBuilder()
creates an empty object |
Method Summary | |
---|---|
BasicDBObjectBuilder |
add(java.lang.String key,
java.lang.Object val)
same as appends |
BasicDBObjectBuilder |
append(java.lang.String key,
java.lang.Object val)
appends the key/value to the active object |
DBObject |
get()
gets the base object |
boolean |
isEmpty()
returns true if no key/value was inserted into base object |
BasicDBObjectBuilder |
pop()
pops the active object, which means that the parent object becomes active |
BasicDBObjectBuilder |
push(java.lang.String key)
creates an new empty object and inserts it into the current object with the given key. |
static BasicDBObjectBuilder |
start()
creates an empty object |
static BasicDBObjectBuilder |
start(java.util.Map m)
Creates an object builder from an existing map. |
static BasicDBObjectBuilder |
start(java.lang.String k,
java.lang.Object val)
creates an object with the given key/value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicDBObjectBuilder()
Method Detail |
---|
public static BasicDBObjectBuilder start()
public static BasicDBObjectBuilder start(java.lang.String k, java.lang.Object val)
k
- val
-
public static BasicDBObjectBuilder start(java.util.Map m)
m
- map to use
public BasicDBObjectBuilder append(java.lang.String key, java.lang.Object val)
key
- val
-
public BasicDBObjectBuilder add(java.lang.String key, java.lang.Object val)
key
- val
-
BasicDBObjectBuilder#add(java.lang.String, java.lang.Object)
public BasicDBObjectBuilder push(java.lang.String key)
key
-
public BasicDBObjectBuilder pop()
public DBObject get()
public boolean isEmpty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |