@@ -127,7 +127,7 @@ public static interface OnSubscribeFunc<T> extends Function {
127
127
/**
128
128
* Observable with Function to execute when subscribed to.
129
129
* <p>
130
- * NOTE: Use {@link #create(Func1 )} to create an Observable instead of this method unless you
130
+ * NOTE: Use {@link #create(OnSubscribeFunc )} to create an Observable instead of this constructor unless you
131
131
* specifically have a need for inheritance.
132
132
*
133
133
* @param onSubscribe
@@ -783,29 +783,28 @@ public static <T> Observable<T> never() {
783
783
* the source Observable that emits Observables
784
784
* @return an Observable that emits only the items emitted by the most recently published
785
785
* Observable
786
+ * @deprecated Being renamed to {@link #switchOnNext}
786
787
*/
788
+ @ Deprecated
787
789
public static <T > Observable <T > switchDo (Observable <? extends Observable <? extends T >> sequenceOfSequences ) {
788
- // TODO should this static remain? I have left it because it is an Observable<Observable>
789
790
return create (OperationSwitch .switchDo (sequenceOfSequences ));
790
791
}
791
792
792
793
/**
793
- * On an Observable that emits Observables, creates a single Observable that
794
+ * Given an Observable that emits Observables, creates a single Observable that
794
795
* emits the items emitted by the most recently published of those Observables.
795
796
* <p>
796
797
* <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/switchDo.png">
797
798
*
799
+ * @param sequenceOfSequences
800
+ * the source Observable that emits Observables
798
801
* @return an Observable that emits only the items emitted by the most recently published
799
802
* Observable
800
- * @throws ClassCastException
801
- * if sequence not of type {@code Observable<Observable<T>}
802
803
*/
803
- @ SuppressWarnings ("unchecked" )
804
- public Observable <T > switchDo () {
805
- // TODO can we come up with a better name than this? It should be 'switch' but that is reserved.
806
- // Perhaps 'switchOnNext'?
807
- return create (OperationSwitch .switchDo ((Observable <? extends Observable <? extends T >>) this ));
804
+ public static <T > Observable <T > switchOnNext (Observable <? extends Observable <? extends T >> sequenceOfSequences ) {
805
+ return create (OperationSwitch .switchDo (sequenceOfSequences ));
808
806
}
807
+
809
808
810
809
/**
811
810
* Accepts an Observable and wraps it in another Observable that ensures that the resulting
0 commit comments