|
29 | 29 | import io.reactivex.rxjava3.internal.operators.completable.*;
|
30 | 30 | import io.reactivex.rxjava3.internal.operators.maybe.*;
|
31 | 31 | import io.reactivex.rxjava3.internal.operators.mixed.*;
|
32 |
| -import io.reactivex.rxjava3.internal.operators.single.SingleDelayWithCompletable; |
| 32 | +import io.reactivex.rxjava3.internal.operators.single.*; |
33 | 33 | import io.reactivex.rxjava3.observers.TestObserver;
|
34 | 34 | import io.reactivex.rxjava3.plugins.RxJavaPlugins;
|
35 | 35 | import io.reactivex.rxjava3.schedulers.Schedulers;
|
@@ -414,6 +414,29 @@ public static Completable create(@NonNull CompletableOnSubscribe source) {
|
414 | 414 | return RxJavaPlugins.onAssembly(new CompletableCreate(source));
|
415 | 415 | }
|
416 | 416 |
|
| 417 | + /** |
| 418 | + * Compares two {@link CompletableSource}s and emits {@code true} via a {@link Single} if both complete. |
| 419 | + * <p> |
| 420 | + * <img width="640" height="187" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.sequenceEqual.png" alt=""> |
| 421 | + * <dl> |
| 422 | + * <dt><b>Scheduler:</b></dt> |
| 423 | + * <dd>{@code sequenceEqual} does not operate by default on a particular {@link Scheduler}.</dd> |
| 424 | + * </dl> |
| 425 | + * @param source1 the first {@code CompletableSource} instance |
| 426 | + * @param source2 the second {@code CompletableSource} instance |
| 427 | + * @return the new {@code Single} instance |
| 428 | + * @throws NullPointerException if {@code source1} or {@code source2} is {@code null} |
| 429 | + * @since 3.0.0 |
| 430 | + */ |
| 431 | + @CheckReturnValue |
| 432 | + @NonNull |
| 433 | + @SchedulerSupport(SchedulerSupport.NONE) |
| 434 | + public static Single<Boolean> sequenceEqual(@NonNull CompletableSource source1, @NonNull CompletableSource source2) { // NOPMD |
| 435 | + Objects.requireNonNull(source1, "source1 is null"); |
| 436 | + Objects.requireNonNull(source2, "source2 is null"); |
| 437 | + return mergeArrayDelayError(source1, source2).andThen(Single.just(true)); |
| 438 | + } |
| 439 | + |
417 | 440 | /**
|
418 | 441 | * Constructs a {@code Completable} instance by wrapping the given source callback
|
419 | 442 | * <strong>without any safeguards; you should manage the lifecycle and response
|
|
0 commit comments