com.mongodb
Class BasicDBObjectBuilder

java.lang.Object
  extended by com.mongodb.BasicDBObjectBuilder

public class BasicDBObjectBuilder
extends java.lang.Object

utility for building objects example: BasicDBObjectBuilder.start().add( "name" , "eliot" ).add( "number" , 17 ).get()


Constructor Summary
BasicDBObjectBuilder()
           
 
Method Summary
 BasicDBObjectBuilder add(java.lang.String key, java.lang.Object val)
           
 BasicDBObjectBuilder append(java.lang.String key, java.lang.Object val)
           
 DBObject get()
           
 BasicDBObjectBuilder pop()
           
 BasicDBObjectBuilder push(java.lang.String key)
           
static BasicDBObjectBuilder start()
           
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicDBObjectBuilder

public BasicDBObjectBuilder()
Method Detail

start

public static BasicDBObjectBuilder start()

start

public static BasicDBObjectBuilder start(java.lang.String k,
                                         java.lang.Object val)

start

public static BasicDBObjectBuilder start(java.util.Map m)
Creates an object builder from an existing map.

Parameters:
m - map to use
Returns:
the new builder

append

public BasicDBObjectBuilder append(java.lang.String key,
                                   java.lang.Object val)
Returns:
returns itself so you can chain .append( "a" , 1 ).add( "b" , 1 )

add

public BasicDBObjectBuilder add(java.lang.String key,
                                java.lang.Object val)
Returns:
returns itself so you can chain .add( "a" , 1 ).add( "b" , 1 )

push

public BasicDBObjectBuilder push(java.lang.String key)

pop

public BasicDBObjectBuilder pop()

get

public DBObject get()