File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -39,18 +39,21 @@ object ImplicitFunctionConversions {
39
39
}
40
40
}
41
41
42
+ implicit def toJavaNotification [T ](s : Notification [T ]): rx.Notification [_ <: T ] = s.asJava
43
+ implicit def toScalaNotification [T ](s : rx.Notification [_ <: T ]): Notification [T ] = Notification (s)
44
+
42
45
implicit def toJavaSubscription (s : Subscription ): rx.Subscription = s.asJavaSubscription
43
46
implicit def toScalaSubscription (s : rx.Subscription ): Subscription = Subscription (s)
44
47
45
48
implicit def scalaSchedulerToJavaScheduler (s : Scheduler ): rx.Scheduler = s.asJavaScheduler
46
49
implicit def javaSchedulerToScalaScheduler (s : rx.Scheduler ): Scheduler = Scheduler (s)
47
50
48
51
implicit def toJavaObserver [T ](s : Observer [T ]): rx.Observer [_ >: T ] = s.asJavaObserver
49
- implicit def toScalaObserver [T ](s : rx.Observer [T ]): Observer [T ] = Observer (s)
52
+ implicit def toScalaObserver [T ](s : rx.Observer [_ >: T ]): Observer [T ] = Observer (s)
50
53
51
54
implicit def toJavaObservable [T ](s : Observable [T ]): rx.Observable [_ <: T ] = s.asJavaObservable
52
- implicit def toScalaObservable [T ](s : rx.Observable [T ]): Observable [T ] = Observable (s)
53
-
55
+ implicit def toScalaObservable [T ](s : rx.Observable [_ <: T ]): Observable [T ] = Observable (s)
56
+
54
57
implicit def scalaFunction1ToOnSubscribeFunc [T ](f : rx.lang.scala.Observer [T ] => Subscription ) =
55
58
new rx.Observable .OnSubscribeFunc [T ] {
56
59
def onSubscribe (obs : rx.Observer [_ >: T ]): rx.Subscription = {
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ object Notification {
36
36
}
37
37
38
38
object OnNext {
39
+
40
+ def apply [T ](value : T ): Notification [T ] = {
41
+ Notification (new rx.Notification [T ](value))
42
+ }
43
+
39
44
def unapply [U ](n : Notification [U ]): Option [U ] = n match {
40
45
case n2 : OnNext [U ] => Some (n.asJava.getValue)
41
46
case _ => None
@@ -47,6 +52,11 @@ object Notification {
47
52
}
48
53
49
54
object OnError {
55
+
56
+ def apply [T ](error : Throwable ): Notification [T ] = {
57
+ Notification (new rx.Notification [T ](error))
58
+ }
59
+
50
60
def unapply [U ](n : Notification [U ]): Option [Throwable ] = n match {
51
61
case n2 : OnError [U ] => Some (n2.asJava.getThrowable)
52
62
case _ => None
@@ -56,6 +66,11 @@ object Notification {
56
66
class OnCompleted [T ](val asJava : rx.Notification [_ <: T ]) extends Notification [T ] {}
57
67
58
68
object OnCompleted {
69
+
70
+ def apply [T ](): Notification [T ] = {
71
+ Notification (new rx.Notification ())
72
+ }
73
+
59
74
def unapply [U ](n : Notification [U ]): Option [Unit ] = n match {
60
75
case n2 : OnCompleted [U ] => Some ()
61
76
case _ => None
You can’t perform that action at this time.
0 commit comments