what-the-bank/sources/o/C13203fTq.java

114 lines
3.4 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.Objects;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.stream.Collector;
/* renamed from: o.fTq, reason: case insensitive filesystem */
/* loaded from: classes6.dex */
public final class C13203fTq<T, A, R> extends AbstractC13175fSw<R> implements InterfaceC13204fTr<R> {
private AbstractC13163fSk<T> b;
private Collector<? super T, A, R> c;
public C13203fTq(AbstractC13163fSk<T> abstractC13163fSk, Collector<? super T, A, R> collector) {
this.b = abstractC13163fSk;
this.c = collector;
}
@Override // o.InterfaceC13204fTr
public final AbstractC13163fSk<R> b() {
return new C13201fTo(this.b, this.c);
}
@Override // o.AbstractC13175fSw
public final void e(InterfaceC13176fSx<? super R> interfaceC13176fSx) {
try {
this.b.subscribe(new RVV(interfaceC13176fSx, this.c.supplier().get(), this.c.accumulator(), this.c.finisher()));
} catch (Throwable th) {
C13147fSI.c(th);
EnumC13195fTi.c(th, interfaceC13176fSx);
}
}
/* renamed from: o.fTq$RVV */
/* loaded from: classes6.dex */
static final class RVV<T, A, R> implements InterfaceC13174fSv<T>, fSJ {
private A a;
private BiConsumer<A, T> b;
private InterfaceC13176fSx<? super R> c;
private boolean d;
private Function<A, R> e;
private fSJ g;
RVV(InterfaceC13176fSx<? super R> interfaceC13176fSx, A a, BiConsumer<A, T> biConsumer, Function<A, R> function) {
this.c = interfaceC13176fSx;
this.a = a;
this.b = biConsumer;
this.e = function;
}
@Override // o.InterfaceC13174fSv
public final void onSubscribe(fSJ fsj) {
if (EnumC13192fTf.d(this.g, fsj)) {
this.g = fsj;
this.c.onSubscribe(this);
}
}
@Override // o.InterfaceC13174fSv
public final void onNext(T t) {
if (this.d) {
return;
}
try {
this.b.accept(this.a, t);
} catch (Throwable th) {
C13147fSI.c(th);
this.g.dispose();
onError(th);
}
}
@Override // o.InterfaceC13174fSv
public final void onError(Throwable th) {
if (this.d) {
C13418fZu.c(th);
return;
}
this.d = true;
this.g = EnumC13192fTf.DISPOSED;
this.a = null;
this.c.onError(th);
}
@Override // o.InterfaceC13174fSv
public final void onComplete() {
if (this.d) {
return;
}
this.d = true;
this.g = EnumC13192fTf.DISPOSED;
A a = this.a;
this.a = null;
try {
this.c.e(Objects.requireNonNull(this.e.apply(a), "The finisher returned a null value"));
} catch (Throwable th) {
C13147fSI.c(th);
this.c.onError(th);
}
}
@Override // o.fSJ
public final void dispose() {
this.g.dispose();
this.g = EnumC13192fTf.DISPOSED;
}
@Override // o.fSJ
public final boolean isDisposed() {
return this.g == EnumC13192fTf.DISPOSED;
}
}
}