|
27 | 27 | import io.reactivex.internal.operators.maybe.*;
|
28 | 28 | import io.reactivex.internal.operators.mixed.*;
|
29 | 29 | import io.reactivex.internal.operators.single.*;
|
30 |
| -import io.reactivex.internal.util.ExceptionHelper; |
31 | 30 | import io.reactivex.observers.TestObserver;
|
32 | 31 | import io.reactivex.plugins.RxJavaPlugins;
|
33 | 32 | import io.reactivex.schedulers.Schedulers;
|
@@ -1182,29 +1181,6 @@ public final Completable andThen(CompletableSource next) {
|
1182 | 1181 | return RxJavaPlugins.onAssembly(new CompletableAndThenCompletable(this, next));
|
1183 | 1182 | }
|
1184 | 1183 |
|
1185 |
| - /** |
1186 |
| - * Calls the specified converter function during assembly time and returns its resulting value. |
1187 |
| - * <p> |
1188 |
| - * <img width="640" height="751" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.as.png" alt=""> |
1189 |
| - * <p> |
1190 |
| - * This allows fluent conversion to any other type. |
1191 |
| - * <dl> |
1192 |
| - * <dt><b>Scheduler:</b></dt> |
1193 |
| - * <dd>{@code as} does not operate by default on a particular {@link Scheduler}.</dd> |
1194 |
| - * </dl> |
1195 |
| - * <p>History: 2.1.7 - experimental |
1196 |
| - * @param <R> the resulting object type |
1197 |
| - * @param converter the function that receives the current Completable instance and returns a value |
1198 |
| - * @return the converted value |
1199 |
| - * @throws NullPointerException if converter is null |
1200 |
| - * @since 2.2 |
1201 |
| - */ |
1202 |
| - @CheckReturnValue |
1203 |
| - @SchedulerSupport(SchedulerSupport.NONE) |
1204 |
| - public final <R> R as(@NonNull CompletableConverter<? extends R> converter) { |
1205 |
| - return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); |
1206 |
| - } |
1207 |
| - |
1208 | 1184 | /**
|
1209 | 1185 | * Subscribes to and awaits the termination of this Completable instance in a blocking manner and
|
1210 | 1186 | * rethrows any exception emitted.
|
@@ -2578,27 +2554,26 @@ private Completable timeout0(long timeout, TimeUnit unit, Scheduler scheduler, C
|
2578 | 2554 | }
|
2579 | 2555 |
|
2580 | 2556 | /**
|
2581 |
| - * Allows fluent conversion to another type via a function callback. |
| 2557 | + * Calls the specified converter function during assembly time and returns its resulting value. |
2582 | 2558 | * <p>
|
2583 | 2559 | * <img width="640" height="751" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.to.png" alt="">
|
| 2560 | + * <p> |
| 2561 | + * This allows fluent conversion to any other type. |
2584 | 2562 | * <dl>
|
2585 | 2563 | * <dt><b>Scheduler:</b></dt>
|
2586 | 2564 | * <dd>{@code to} does not operate by default on a particular {@link Scheduler}.</dd>
|
2587 | 2565 | * </dl>
|
2588 |
| - * @param <U> the output type |
2589 |
| - * @param converter the function called with this which should return some other value. |
| 2566 | + * <p>History: 2.1.7 - experimental |
| 2567 | + * @param <R> the resulting object type |
| 2568 | + * @param converter the function that receives the current Completable instance and returns a value |
2590 | 2569 | * @return the converted value
|
2591 | 2570 | * @throws NullPointerException if converter is null
|
| 2571 | + * @since 2.2 |
2592 | 2572 | */
|
2593 | 2573 | @CheckReturnValue
|
2594 | 2574 | @SchedulerSupport(SchedulerSupport.NONE)
|
2595 |
| - public final <U> U to(Function<? super Completable, U> converter) { |
2596 |
| - try { |
2597 |
| - return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); |
2598 |
| - } catch (Throwable ex) { |
2599 |
| - Exceptions.throwIfFatal(ex); |
2600 |
| - throw ExceptionHelper.wrapOrThrow(ex); |
2601 |
| - } |
| 2575 | + public final <R> R to(@NonNull CompletableConverter<? extends R> converter) { |
| 2576 | + return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); |
2602 | 2577 | }
|
2603 | 2578 |
|
2604 | 2579 | /**
|
|
0 commit comments