public class BasicDBObjectBuilder extends Object
Constructor and Description |
---|
BasicDBObjectBuilder()
creates an empty object
|
Modifier and Type | Method and Description |
---|---|
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
|
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 usepublic 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()