54 lines
1.6 KiB
Java
54 lines
1.6 KiB
Java
|
package com.google.android.gms.internal.vision;
|
||
|
|
||
|
import java.util.concurrent.ConcurrentHashMap;
|
||
|
import java.util.concurrent.ConcurrentMap;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class zzhs {
|
||
|
private static final zzhs zzzw = new zzhs();
|
||
|
private final zzhx zzzx;
|
||
|
private final ConcurrentMap<Class<?>, zzhw<?>> zzzy = new ConcurrentHashMap();
|
||
|
|
||
|
public final <T> zzhw<T> zzf(Class<T> cls) {
|
||
|
zzga.zza(cls, "messageType");
|
||
|
zzhw<T> zzhwVar = (zzhw) this.zzzy.get(cls);
|
||
|
if (zzhwVar != null) {
|
||
|
return zzhwVar;
|
||
|
}
|
||
|
zzhw<T> zze = this.zzzx.zze(cls);
|
||
|
zzga.zza(cls, "messageType");
|
||
|
zzga.zza(zze, "schema");
|
||
|
zzhw<T> zzhwVar2 = (zzhw) this.zzzy.putIfAbsent(cls, zze);
|
||
|
return zzhwVar2 != null ? zzhwVar2 : zze;
|
||
|
}
|
||
|
|
||
|
public final <T> zzhw<T> zzs(T t) {
|
||
|
return zzf(t.getClass());
|
||
|
}
|
||
|
|
||
|
private zzhs() {
|
||
|
String[] strArr = {"com.google.protobuf.AndroidProto3SchemaFactory"};
|
||
|
zzhx zzhxVar = null;
|
||
|
for (int i = 0; i <= 0; i++) {
|
||
|
zzhxVar = zzr(strArr[0]);
|
||
|
if (zzhxVar != null) {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
this.zzzx = zzhxVar == null ? new zzgu() : zzhxVar;
|
||
|
}
|
||
|
|
||
|
private static zzhx zzr(String str) {
|
||
|
try {
|
||
|
return (zzhx) Class.forName(str).getConstructor(new Class[0]).newInstance(new Object[0]);
|
||
|
} catch (Throwable unused) {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static zzhs zzgl() {
|
||
|
return zzzw;
|
||
|
}
|
||
|
}
|