24 lines
832 B
Java
24 lines
832 B
Java
package com.google.android.libraries.places.internal;
|
|
|
|
import com.google.gson.FieldNamingPolicy;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.GsonBuilder;
|
|
import com.google.gson.JsonSyntaxException;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class zzej {
|
|
private final Gson zza = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
|
|
|
|
public final Object zza(String str, Class cls) throws zzdh {
|
|
try {
|
|
return this.zza.fromJson(str, cls);
|
|
} catch (JsonSyntaxException unused) {
|
|
String name = cls.getName();
|
|
StringBuilder sb = new StringBuilder("Could not convert JSON string to ");
|
|
sb.append(name);
|
|
sb.append(" due to syntax errors.");
|
|
throw new zzdh(sb.toString());
|
|
}
|
|
}
|
|
}
|