MCPcopy Index your code
hub / github.com/ReactiveX/RxJava / wrap

Method wrap

src/main/java/io/reactivex/rxjava3/core/Single.java:2047–2056  ·  view source on GitHub ↗

Wraps a SingleSource instance into a new Single instance if not already a Single instance. Scheduler: wrap does no

(@NonNull SingleSource<T> source)

Source from the content-addressed store, hash-verified

2045 * @throws NullPointerException if {@code source} is {@code null}
2046 */
2047 @CheckReturnValue
2048 @NonNull
2049 @SchedulerSupport(SchedulerSupport.NONE)
2050 public static <@NonNull T> Single<T> wrap(@NonNull SingleSource<T> source) {
2051 Objects.requireNonNull(source, "source is null");
2052 if (source instanceof Single) {
2053 return RxJavaPlugins.onAssembly((Single<T>)source);
2054 }
2055 return RxJavaPlugins.onAssembly(new SingleFromUnsafeSource<>(source));
2056 }
2057
2058 /**
2059 * Waits until all {@link SingleSource} sources provided by the {@link Iterable} sequence signal a success

Callers 8

wrapMethod · 0.95
startWithMethod · 0.95
startWithMethod · 0.95
ambArrayMethod · 0.95
composeMethod · 0.95
startWithMethod · 0.95
startWithMethod · 0.95
startWithMethod · 0.95

Calls 1

onAssemblyMethod · 0.95

Tested by 1

wrapMethod · 0.76