public DBCollection getCollection ( final String name ) { DBCollection collection = collectionCache . get ( name ) ; if ( collection != null ) { return collection ; } collection = new DBCollection ( name , this , executor ) ; if ( mongo . getMongoClientOptions ( ) . getDbDecoderFactory ( ) != DefaultDBDecoder . FACTORY ) { collection . setDBDecoderFactory ( mongo . getMongoClientOptions ( ) . getDbDecoderFactory ( ) ) ; } if ( mongo . getMongoClientOptions ( ) . getDbEncoderFactory ( ) != DefaultDBEncoder . FACTORY ) { collection . setDBEncoderFactory ( mongo . getMongoClientOptions ( ) . getDbEncoderFactory ( ) ) ; } DBCollection old = collectionCache . putIfAbsent ( name , collection ) ; return old != null ? old : collection ; }
Gets a collection with a given name .