49 lines
2.1 KiB
Java
49 lines
2.1 KiB
Java
package io.reactivex;
|
|
|
|
import io.reactivex.exceptions.Exceptions;
|
|
import io.reactivex.functions.Function;
|
|
import io.reactivex.internal.functions.ObjectHelper;
|
|
import io.reactivex.internal.fuseable.FuseToObservable;
|
|
import io.reactivex.internal.observers.BlockingMultiObserver;
|
|
import io.reactivex.internal.operators.single.SingleMap;
|
|
import io.reactivex.internal.operators.single.SingleToObservable;
|
|
import io.reactivex.plugins.RxJavaPlugins;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public abstract class Single<T> implements SingleSource<T> {
|
|
public final <R> Single<R> a(Function<? super T, ? extends R> function) {
|
|
ObjectHelper.a(function, "mapper is null");
|
|
return RxJavaPlugins.a(new SingleMap(this, function));
|
|
}
|
|
|
|
public final T b() {
|
|
BlockingMultiObserver blockingMultiObserver = new BlockingMultiObserver();
|
|
a(blockingMultiObserver);
|
|
return (T) blockingMultiObserver.a();
|
|
}
|
|
|
|
protected abstract void b(SingleObserver<? super T> singleObserver);
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public final Observable<T> c() {
|
|
return this instanceof FuseToObservable ? ((FuseToObservable) this).a() : RxJavaPlugins.a(new SingleToObservable(this));
|
|
}
|
|
|
|
@Override // io.reactivex.SingleSource
|
|
public final void a(SingleObserver<? super T> singleObserver) {
|
|
ObjectHelper.a(singleObserver, "subscriber is null");
|
|
SingleObserver<? super T> a = RxJavaPlugins.a(this, singleObserver);
|
|
ObjectHelper.a(a, "The RxJavaPlugins.onSubscribe hook returned a null SingleObserver. Please check the handler provided to RxJavaPlugins.setOnSingleSubscribe for invalid null returns. Further reading: https://github.com/ReactiveX/RxJava/wiki/Plugins");
|
|
try {
|
|
b(a);
|
|
} catch (NullPointerException e) {
|
|
throw e;
|
|
} catch (Throwable th) {
|
|
Exceptions.b(th);
|
|
NullPointerException nullPointerException = new NullPointerException("subscribeActual failed");
|
|
nullPointerException.initCause(th);
|
|
throw nullPointerException;
|
|
}
|
|
}
|
|
}
|