Browse files

Updated converters

  • Loading branch information...
1 parent 1156227 commit 0e07e26231fd1d67856ec2a57a6a2893bc28c83b @rozza rozza committed Dec 14, 2012
View
2 casbah-commons/src/main/scala/Implicits.scala
@@ -23,7 +23,7 @@
package com.mongodb.casbah
package commons
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
trait Implicits {
import com.mongodb.{ DBObject, BasicDBObject, BasicDBList }
View
2 casbah-commons/src/main/scala/MongoDBList.scala
@@ -26,7 +26,7 @@ package commons
import com.mongodb.casbah.commons.Imports._
import scala.collection.mutable._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
class MongoDBList(val underlying: BasicDBList = new BasicDBList) extends Seq[Any] {
View
2 casbah-commons/src/main/scala/conversions/ScalaConversions.scala
@@ -231,7 +231,7 @@ trait ScalaRegexSerializer extends MongoConversionHelper {
trait ScalaJCollectionSerializer extends MongoConversionHelper {
private val transformer = new Transformer {
- import scalaj.collection.Imports._
+ import _root_.scala.collection.JavaConverters._
def transform(o: AnyRef): AnyRef = o match {
case mdbo: MongoDBObject => mdbo.underlying
View
4 casbah-commons/src/test/scala/MongoDBListSpec.scala
@@ -24,7 +24,7 @@ package com.mongodb.casbah.test.commons
import com.mongodb.casbah.commons.Imports._
import com.mongodb.casbah.commons.test.CasbahMutableSpecification
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
class MongoDBListSpec extends CasbahMutableSpecification {
@@ -87,7 +87,7 @@ class MongoDBListSpec extends CasbahMutableSpecification {
"Convert tuple pairs correctly" in {
val dbList = MongoDBList("omg" -> "ponies")
dbList must haveSize(1)
- dbList must beEqualTo(List(MongoDBObject("omg" -> "ponies")))
+ dbList must haveTheSameElementsAs(List(MongoDBObject("omg" -> "ponies")))
}
View
2 casbah-core/src/main/scala/Implicits.scala
@@ -22,7 +22,7 @@
package com.mongodb.casbah
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import org.scala_tools.time.Imports._
/**
View
2 casbah-core/src/main/scala/MongoClient.scala
@@ -23,7 +23,7 @@ package com.mongodb.casbah
import com.mongodb.casbah.Imports._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import com.mongodb.{ MongoClient => JavaMongoClient }
View
2 casbah-core/src/main/scala/MongoClientOptions.scala
@@ -23,7 +23,7 @@ package com.mongodb.casbah
import com.mongodb.casbah.Imports._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import com.mongodb.{DBDecoderFactory, DBEncoderFactory, MongoClientOptions => JavaMongoClientOptions}
View
2 casbah-core/src/main/scala/MongoClientURI.scala
@@ -23,7 +23,7 @@ package com.mongodb.casbah
import com.mongodb.casbah.Imports._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
/**
*
View
2 casbah-core/src/main/scala/MongoCollection.scala
@@ -31,7 +31,7 @@ import com.mongodb.casbah.map_reduce.{ MapReduceResult, MapReduceCommand }
import scala.util.control.Exception._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import collection.mutable.ArrayBuffer
/**
View
2 casbah-core/src/main/scala/MongoConnection.scala
@@ -24,7 +24,7 @@ package com.mongodb.casbah
import com.mongodb.casbah.Imports._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import com.mongodb.{ Mongo, ServerAddress }
View
2 casbah-core/src/main/scala/MongoCursor.scala
@@ -27,7 +27,7 @@ import com.mongodb.DBCursor
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.commons.Logging
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
/**
* Scala wrapper for Mongo DBCursors,
View
2 casbah-core/src/main/scala/MongoDB.scala
@@ -26,7 +26,7 @@ import com.mongodb.casbah.Imports._
import com.mongodb.casbah.commons.Logging
import com.mongodb.casbah.map_reduce.{ MapReduceResult, MapReduceCommand }
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
/**
* Wrapper for the Mongo <code>DB</code> object providing scala-friendly functionality.
View
2 casbah-core/src/main/scala/MongoOptions.scala
@@ -24,7 +24,7 @@ package com.mongodb.casbah
import com.mongodb.casbah.Imports._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import com.mongodb.{ DBDecoderFactory, DBEncoderFactory }
View
2 casbah-core/src/main/scala/MongoURI.scala
@@ -24,7 +24,7 @@ package com.mongodb.casbah
import com.mongodb.casbah.Imports._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
/**
*
View
2 casbah-core/src/main/scala/ReadPreference.scala
@@ -16,7 +16,7 @@
*/
package com.mongodb.casbah
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import com.mongodb.DBObject
/**
View
2 casbah-core/src/main/scala/WriteConcern.scala
@@ -22,7 +22,7 @@
package com.mongodb.casbah
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
/**
* Helper class for creating WriteConcern instances
View
2 casbah-core/src/main/scala/map_reduce/MapReduceCommand.scala
@@ -26,7 +26,7 @@ package map_reduce
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.commons.Logging
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
class MapReduceException(msg: String) extends MongoException("MongoDB Map/Reduce Error: " + msg)
View
2 casbah-core/src/main/scala/map_reduce/MapReduceResult.scala
@@ -26,7 +26,7 @@ package map_reduce
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.commons.Logging
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
object MapReduceResult extends Logging {
View
3 casbah-gridfs/src/main/scala/GridFS.scala
@@ -19,7 +19,6 @@
* http://github.com/mongodb/casbah
*
*/
-
package com.mongodb.casbah
package gridfs
@@ -34,7 +33,7 @@ import com.mongodb.gridfs.{ GridFS => MongoGridFS, GridFSDBFile => MongoGridFSDB
import java.io._
import scala.reflect._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import org.scala_tools.time.Imports._
View
2 casbah-gridfs/src/main/scala/Implicits.scala
@@ -26,7 +26,7 @@ package gridfs
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.gridfs.Imports._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
trait Implicits {
implicit def wrapDBFile(in: com.mongodb.gridfs.GridFSDBFile) = new GridFSDBFile(in)
View
2 casbah-gridfs/src/main/scala/JodaGridFS.scala
@@ -34,7 +34,7 @@ import com.mongodb.gridfs.{ GridFS => MongoGridFS, GridFSDBFile => MongoGridFSDB
import java.io._
import scala.reflect._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import org.scala_tools.time.Imports._
View
2 casbah-query/src/main/scala/BarewordOperators.scala
@@ -26,7 +26,7 @@ import com.mongodb.casbah.commons.Logging
import com.mongodb.casbah.query.Imports._
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
/**
* Base Operator class for Bareword Operators.
View
2 casbah-query/src/main/scala/CoreOperators.scala
@@ -24,7 +24,7 @@ package com.mongodb.casbah.query.dsl
import com.mongodb.casbah.commons.Logging
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import com.mongodb.casbah.query.Imports._
View
6 casbah-query/src/main/scala/aggregation/package.scala
@@ -23,7 +23,7 @@ package com.mongodb.casbah.query.dsl
import com.mongodb.casbah.commons.Logging
-import scalaj.collection.Imports._
+import scala.collection.JavaConverters._
import com.mongodb.casbah.query.Imports._
@@ -66,8 +66,8 @@ package aggregation {
AggregationPipeline(pipeline)
}
}
-
- class AggregationPipeline private(protected[mongodb] val list: MongoDBList = MongoDBList.empty) extends PipelineOperations {
+
+ class AggregationPipeline private(protected[mongodb] val list: MongoDBList = MongoDBList.empty) extends PipelineOperations {
def apply(n: Int): DBObject = list(n).asInstanceOf[DBObject]
def size: Int = list.size
override def toString = "AggregationPipeline { " + list.toString + " } ";

0 comments on commit 0e07e26

Please sign in to comment.