Skip to content

Commit 9e81deb

Browse files
make all constructors private
1 parent 70c14a3 commit 9e81deb

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Notification.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sealed trait Notification[+T] {
88
}
99

1010
/**
11-
* Provides pattern matching support for Notifications.
11+
* Provides pattern matching support and constructors for Notifications.
1212
*
1313
* Example:
1414
* {{{

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Observable.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package rx.lang.scala
2020
/**
2121
* The Observable interface that implements the Reactive Pattern.
2222
*/
23+
// constructor is private because users should use apply in companion
2324
class Observable[+T] private[scala] (val asJava: rx.Observable[_ <: T])
2425
// Uncommenting this line combined with `new Observable(...)` instead of `new Observable[T](...)`
2526
// makes the compiler crash

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/observables/BlockingObservable.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import rx.lang.scala.ImplicitFunctionConversions._
2323
*
2424
* You can obtain a BlockingObservable from an Observable using [[Observable.toBlockingObservable]]
2525
*/
26+
// constructor is private because users should use Observable.toBlockingObservable
2627
class BlockingObservable[+T] private[scala] (val asJava: rx.observables.BlockingObservable[_ <: T])
2728
extends AnyVal
2829
{

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/util/Timestamped.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package rx.lang.scala.util
33
/**
44
* Wraps a value and a timestamp.
55
*/
6-
class Timestamped[+T](val asJava: rx.util.Timestamped[_ <: T]) extends AnyVal {
6+
// constructor is private because users should use apply from companion
7+
class Timestamped[+T] private[util] (val asJava: rx.util.Timestamped[_ <: T]) extends AnyVal {
78
/**
89
* Returns the timestamp, in milliseconds.
910
*/

0 commit comments

Comments
 (0)