Wraps the given CompletableSource into a Completable if not already Completable. Scheduler: wrap does not o
(@NonNull CompletableSource source)
| 1288 | * @throws NullPointerException if {@code source} is {@code null} |
| 1289 | */ |
| 1290 | @CheckReturnValue |
| 1291 | @NonNull |
| 1292 | @SchedulerSupport(SchedulerSupport.NONE) |
| 1293 | public static Completable wrap(@NonNull CompletableSource source) { |
| 1294 | Objects.requireNonNull(source, "source is null"); |
| 1295 | if (source instanceof Completable) { |
| 1296 | return RxJavaPlugins.onAssembly((Completable)source); |
| 1297 | } |
| 1298 | return RxJavaPlugins.onAssembly(new CompletableFromUnsafeSource(source)); |
| 1299 | } |
| 1300 | |
| 1301 | /** |
| 1302 | * Returns a {@code Completable} that emits the a terminated event of either this {@code Completable} |