2021-06-27 20:44:35 +00:00
|
|
|
package c.i.d;
|
|
|
|
|
|
|
|
import c.i.a.f.e.o.c;
|
|
|
|
import com.google.gson.DefaultDateTypeAdapter;
|
|
|
|
import com.google.gson.Gson;
|
|
|
|
import com.google.gson.TypeAdapter;
|
|
|
|
import com.google.gson.internal.Excluder;
|
|
|
|
import com.google.gson.internal.bind.TreeTypeAdapter;
|
|
|
|
import com.google.gson.internal.bind.TypeAdapters;
|
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
|
import java.lang.reflect.Type;
|
|
|
|
import java.sql.Timestamp;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
/* compiled from: GsonBuilder */
|
|
|
|
public final class e {
|
|
|
|
public Excluder a = Excluder.i;
|
|
|
|
public n b = n.DEFAULT;
|
|
|
|
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
2021-07-13 20:23:20 +00:00
|
|
|
public d f1384c = c.IDENTITY;
|
2021-06-27 20:44:35 +00:00
|
|
|
public final Map<Type, f<?>> d = new HashMap();
|
|
|
|
public final List<o> e = new ArrayList();
|
|
|
|
public final List<o> f = new ArrayList();
|
|
|
|
public boolean g = false;
|
|
|
|
public int h = 2;
|
|
|
|
public int i = 2;
|
|
|
|
public boolean j = true;
|
|
|
|
|
|
|
|
public Gson a() {
|
|
|
|
ArrayList arrayList = new ArrayList(this.f.size() + this.e.size() + 3);
|
|
|
|
arrayList.addAll(this.e);
|
|
|
|
Collections.reverse(arrayList);
|
|
|
|
ArrayList arrayList2 = new ArrayList(this.f);
|
|
|
|
Collections.reverse(arrayList2);
|
|
|
|
arrayList.addAll(arrayList2);
|
|
|
|
int i = this.h;
|
|
|
|
int i2 = this.i;
|
|
|
|
if (!(i == 2 || i2 == 2)) {
|
|
|
|
DefaultDateTypeAdapter defaultDateTypeAdapter = new DefaultDateTypeAdapter(Date.class, i, i2);
|
|
|
|
DefaultDateTypeAdapter defaultDateTypeAdapter2 = new DefaultDateTypeAdapter(Timestamp.class, i, i2);
|
|
|
|
DefaultDateTypeAdapter defaultDateTypeAdapter3 = new DefaultDateTypeAdapter(java.sql.Date.class, i, i2);
|
|
|
|
TypeAdapter<Class> typeAdapter = TypeAdapters.a;
|
|
|
|
arrayList.add(new TypeAdapters.AnonymousClass32(Date.class, defaultDateTypeAdapter));
|
|
|
|
arrayList.add(new TypeAdapters.AnonymousClass32(Timestamp.class, defaultDateTypeAdapter2));
|
|
|
|
arrayList.add(new TypeAdapters.AnonymousClass32(java.sql.Date.class, defaultDateTypeAdapter3));
|
|
|
|
}
|
2021-07-13 20:23:20 +00:00
|
|
|
return new Gson(this.a, this.f1384c, this.d, this.g, false, false, this.j, false, false, false, this.b, null, this.h, this.i, this.e, this.f, arrayList);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public e b(Type type, Object obj) {
|
|
|
|
boolean z2 = obj instanceof m;
|
|
|
|
boolean z3 = true;
|
|
|
|
c.j(z2 || (obj instanceof i) || (obj instanceof f) || (obj instanceof TypeAdapter));
|
|
|
|
if (obj instanceof f) {
|
|
|
|
this.d.put(type, (f) obj);
|
|
|
|
}
|
|
|
|
if (z2 || (obj instanceof i)) {
|
|
|
|
TypeToken<?> typeToken = TypeToken.get(type);
|
|
|
|
List<o> list = this.e;
|
|
|
|
if (typeToken.getType() != typeToken.getRawType()) {
|
|
|
|
z3 = false;
|
|
|
|
}
|
|
|
|
list.add(new TreeTypeAdapter.SingleTypeFactory(obj, typeToken, z3, null));
|
|
|
|
}
|
|
|
|
if (obj instanceof TypeAdapter) {
|
|
|
|
List<o> list2 = this.e;
|
|
|
|
TypeAdapter<Class> typeAdapter = TypeAdapters.a;
|
|
|
|
list2.add(new TypeAdapters.AnonymousClass31(TypeToken.get(type), (TypeAdapter) obj));
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|