File tree Expand file tree Collapse file tree 2 files changed +4
-18
lines changed
src/main/scala/com/sfxcode/nosql/mongo Expand file tree Collapse file tree 2 files changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,8 @@ abstract class AbstractConverterPlugin {
1313
1414 def customClassList : List [Class [_]] = List ()
1515
16- def hasCustomClass (v : Any ): Boolean = {
17- customClassList.foreach(c => {
18- if (c.isAssignableFrom(v.getClass)) {
19- return true
20- }
21- })
22- false
23- }
16+ def hasCustomClass (v : Any ): Boolean =
17+ customClassList.exists(c => c.isAssignableFrom(v.getClass))
2418
2519 def objectToBson (value : AnyRef ): BsonValue = {
2620 val map : Map [String , Any ] = ClassUtil .membersToMap(value)
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.sfxcode.nosql.mongo.operation
22
33import java .util .concurrent .TimeUnit
44
5+ import com .typesafe .scalalogging .LazyLogging
56import org .mongodb .scala ._
67
78import scala .concurrent .duration .Duration
@@ -27,7 +28,7 @@ trait ObservableIncludes {
2728
2829 }
2930
30- trait ImplicitObservable [C ] {
31+ trait ImplicitObservable [C ] extends LazyLogging {
3132 val observable : Observable [C ]
3233 val debugString : C => String
3334
@@ -39,15 +40,6 @@ trait ObservableIncludes {
3940 def headResult (maxWait : Int = DefaultMaxWait ): C =
4041 Await .result(observable.head(), Duration (maxWait, TimeUnit .SECONDS ))
4142
42- def printResults (initial : String = " " ): Unit = {
43- if (initial.length > 0 ) print(initial)
44- results().foreach(res => {
45- println(debugString(res))
46- })
47- }
48-
49- def printHeadResult (initial : String = " " ): Unit =
50- println(s " $initial${debugString(headResult())}" )
5143 }
5244
5345}
You can’t perform that action at this time.
0 commit comments