Skip to content

Commit 6880855

Browse files
committed
remove toMaybe as well
1 parent 00ec527 commit 6880855

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

src/main/java/io/reactivex/Observable.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import io.reactivex.internal.fuseable.ScalarCallable;
2727
import io.reactivex.internal.observers.*;
2828
import io.reactivex.internal.operators.flowable.FlowableFromObservable;
29-
import io.reactivex.internal.operators.maybe.MaybeFromObservable;
3029
import io.reactivex.internal.operators.observable.*;
3130
import io.reactivex.internal.util.*;
3231
import io.reactivex.observables.*;
@@ -11580,21 +11579,6 @@ public final Flowable<T> toFlowable(BackpressureStrategy strategy) {
1158011579
}
1158111580
}
1158211581

11583-
/**
11584-
* Converts this Observable into a Maybe and expects this Observable to have at most one item
11585-
* or a completion signal; otherwise the resulting Maybe will signal an IndexOutOfBoundsException.
11586-
* <dl>
11587-
* <dt><b>Scheduler:</b></dt>
11588-
* <dd>{@code toMaybe} does not operate by default on a particular {@link Scheduler}.</dd>
11589-
* </dl>
11590-
* @return the new Maybe instance
11591-
* @since 2.0
11592-
*/
11593-
@SchedulerSupport(SchedulerSupport.NONE)
11594-
public final Maybe<T> toMaybe() {
11595-
return new MaybeFromObservable<T>(this);
11596-
}
11597-
1159811582
/**
1159911583
* Returns a Single that emits a list that contains the items emitted by the source ObservableSource, in a
1160011584
* sorted order. Each item emitted by the ObservableSource must implement {@link Comparable} with respect to all

src/test/java/io/reactivex/maybe/MaybeTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void fromFlowableDisposeComposesThrough() {
102102
public void fromObservableEmpty() {
103103

104104
Observable.empty()
105-
.toMaybe()
105+
.singleElement()
106106
.test()
107107
.assertResult();
108108
}
@@ -111,7 +111,7 @@ public void fromObservableEmpty() {
111111
public void fromObservableJust() {
112112

113113
Observable.just(1)
114-
.toMaybe()
114+
.singleElement()
115115
.test()
116116
.assertResult(1);
117117
}
@@ -120,7 +120,7 @@ public void fromObservableJust() {
120120
public void fromObservableError() {
121121

122122
Observable.error(new TestException())
123-
.toMaybe()
123+
.singleElement()
124124
.test()
125125
.assertFailure(TestException.class);
126126
}
@@ -137,7 +137,7 @@ public void fromObservableValueAndError() {
137137
public void fromObservableMany() {
138138

139139
Observable.range(1, 2)
140-
.toMaybe()
140+
.singleElement()
141141
.test()
142142
.assertFailure(IndexOutOfBoundsException.class);
143143
}
@@ -146,7 +146,7 @@ public void fromObservableMany() {
146146
public void fromObservableDisposeComposesThrough() {
147147
PublishSubject<Integer> pp = PublishSubject.create();
148148

149-
TestObserver<Integer> ts = pp.toMaybe().test(false);
149+
TestObserver<Integer> ts = pp.singleElement().test(false);
150150

151151
assertTrue(pp.hasObservers());
152152

@@ -159,7 +159,7 @@ public void fromObservableDisposeComposesThrough() {
159159
public void fromObservableDisposeComposesThroughImmediatelyCancelled() {
160160
PublishSubject<Integer> pp = PublishSubject.create();
161161

162-
pp.toMaybe().test(true);
162+
pp.singleElement().test(true);
163163

164164
assertFalse(pp.hasObservers());
165165
}
@@ -337,7 +337,7 @@ public void flowableMaybeFlowable() {
337337

338338
@Test
339339
public void obervableMaybeobervable() {
340-
Observable.just(1).toMaybe().toObservable().test().assertResult(1);
340+
Observable.just(1).singleElement().toObservable().test().assertResult(1);
341341
}
342342

343343
@Test

0 commit comments

Comments
 (0)