Wraps a MaybeSource instance into a new Maybe instance if not already a Maybe instance. Scheduler: wrap does not op
(@NonNull MaybeSource<T> source)
| 2279 | * @throws NullPointerException if {@code source} is {@code null} |
| 2280 | */ |
| 2281 | @CheckReturnValue |
| 2282 | @NonNull |
| 2283 | @SchedulerSupport(SchedulerSupport.NONE) |
| 2284 | public static <@NonNull T> Maybe<T> wrap(@NonNull MaybeSource<T> source) { |
| 2285 | if (source instanceof Maybe) { |
| 2286 | return RxJavaPlugins.onAssembly((Maybe<T>)source); |
| 2287 | } |
| 2288 | Objects.requireNonNull(source, "source is null"); |
| 2289 | return RxJavaPlugins.onAssembly(new MaybeUnsafeCreate<>(source)); |
| 2290 | } |
| 2291 | |
| 2292 | /** |
| 2293 | * Returns a {@code Maybe} that emits the results of a specified combiner function applied to combinations of |