Wraps an ObservableSource into an Observable if not already an Observable. Scheduler: wrap does not operate by default on a particular Scheduler. @param the value type @param source the ObservableSource insta
(@NonNull ObservableSource<T> source)
| 4430 | * @throws NullPointerException if {@code source} is {@code null} |
| 4431 | */ |
| 4432 | @CheckReturnValue |
| 4433 | @SchedulerSupport(SchedulerSupport.NONE) |
| 4434 | @NonNull |
| 4435 | public static <@NonNull T> Observable<T> wrap(@NonNull ObservableSource<T> source) { |
| 4436 | Objects.requireNonNull(source, "source is null"); |
| 4437 | if (source instanceof Observable) { |
| 4438 | return RxJavaPlugins.onAssembly((Observable<T>)source); |
| 4439 | } |
| 4440 | return RxJavaPlugins.onAssembly(new ObservableFromUnsafeSource<>(source)); |
| 4441 | } |
| 4442 | |
| 4443 | /** |
| 4444 | * Returns an {@code Observable} that emits the results of a specified combiner function applied to combinations of |