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

163 lines
5.0 KiB
Java

package o;
import com.airbnb.deeplinkdispatch.UrlTreeKt;
import com.bumptech.glide.load.engine.GlideException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import o.InterfaceC12232euN;
import o.RDy;
import o.SCe;
/* renamed from: o.efr, reason: case insensitive filesystem */
/* loaded from: classes.dex */
final class C11467efr<Model, Data> implements SCe<Model, Data> {
private final List<SCe<Model, Data>> a;
private final RDy.Sts<List<Throwable>> b;
/* JADX INFO: Access modifiers changed from: package-private */
public C11467efr(List<SCe<Model, Data>> list, RDy.Sts<List<Throwable>> sts) {
this.a = list;
this.b = sts;
}
@Override // o.SCe
public final SCe.IeS<Data> e(Model model, int i, int i2, unA una) {
SCe.IeS<Data> e;
int size = this.a.size();
ArrayList arrayList = new ArrayList(size);
InterfaceC2545agd interfaceC2545agd = null;
for (int i3 = 0; i3 < size; i3++) {
SCe<Model, Data> sCe = this.a.get(i3);
if (sCe.d(model) && (e = sCe.e(model, i, i2, una)) != null) {
interfaceC2545agd = e.e;
arrayList.add(e.d);
}
}
if (arrayList.isEmpty() || interfaceC2545agd == null) {
return null;
}
return new SCe.IeS<>(interfaceC2545agd, new IeS(arrayList, this.b));
}
@Override // o.SCe
public final boolean d(Model model) {
Iterator<SCe<Model, Data>> it = this.a.iterator();
while (it.hasNext()) {
if (it.next().d(model)) {
return true;
}
}
return false;
}
public final String toString() {
StringBuilder sb = new StringBuilder("MultiModelLoader{modelLoaders=");
sb.append(Arrays.toString(this.a.toArray()));
sb.append(UrlTreeKt.componentParamSuffixChar);
return sb.toString();
}
/* renamed from: o.efr$IeS */
/* loaded from: classes.dex */
static class IeS<Data> implements InterfaceC12232euN<Data>, InterfaceC12232euN.IeS<Data> {
private final List<InterfaceC12232euN<Data>> a;
private List<Throwable> b;
private int c;
private boolean d;
private InterfaceC12232euN.IeS<? super Data> e;
private final RDy.Sts<List<Throwable>> f;
private EnumC3495ayd j;
IeS(List<InterfaceC12232euN<Data>> list, RDy.Sts<List<Throwable>> sts) {
this.f = sts;
if (!list.isEmpty()) {
this.a = list;
this.c = 0;
return;
}
throw new IllegalArgumentException("Must not be empty.");
}
@Override // o.InterfaceC12232euN
public final void c(EnumC3495ayd enumC3495ayd, InterfaceC12232euN.IeS<? super Data> ieS) {
this.j = enumC3495ayd;
this.e = ieS;
this.b = this.f.d();
this.a.get(this.c).c(enumC3495ayd, this);
if (this.d) {
a();
}
}
@Override // o.InterfaceC12232euN
public final void e() {
List<Throwable> list = this.b;
if (list != null) {
this.f.d(list);
}
this.b = null;
Iterator<InterfaceC12232euN<Data>> it = this.a.iterator();
while (it.hasNext()) {
it.next().e();
}
}
@Override // o.InterfaceC12232euN
public final void a() {
this.d = true;
Iterator<InterfaceC12232euN<Data>> it = this.a.iterator();
while (it.hasNext()) {
it.next().a();
}
}
@Override // o.InterfaceC12232euN
public final Class<Data> c() {
return this.a.get(0).c();
}
@Override // o.InterfaceC12232euN
public final pNW d() {
return this.a.get(0).d();
}
@Override // o.InterfaceC12232euN.IeS
public final void a(Data data) {
if (data != null) {
this.e.a((InterfaceC12232euN.IeS<? super Data>) data);
} else {
b();
}
}
@Override // o.InterfaceC12232euN.IeS
public final void a(Exception exc) {
List<Throwable> list = this.b;
if (list != null) {
list.add(exc);
b();
return;
}
throw new NullPointerException("Argument must not be null");
}
private void b() {
if (this.d) {
return;
}
if (this.c < this.a.size() - 1) {
this.c++;
c(this.j, this.e);
} else {
if (this.b != null) {
this.e.a((Exception) new GlideException("Fetch failed", new ArrayList(this.b)));
return;
}
throw new NullPointerException("Argument must not be null");
}
}
}
}