|
||||||||||
| 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(String key,
Object val)
same as appends |
BasicDBObjectBuilder |
append(String key,
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(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(Map m)
Creates an object builder from an existing map. |
static BasicDBObjectBuilder |
start(String k,
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(String k,
Object val)
k - The field nameval - The valuepublic static BasicDBObjectBuilder start(Map m)
m - map to use
public BasicDBObjectBuilder append(String key,
Object val)
key - val -
public BasicDBObjectBuilder add(String key,
Object val)
key - val -
append(String, Object)public BasicDBObjectBuilder push(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 | |||||||||