package g.e.b.h0;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Objects;

/* JADX INFO: loaded from: classes.dex */
public class a<T> {
    public final Class<? super T> a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Type f4166b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f4167c;

    public a() {
        Type genericSuperclass = getClass().getGenericSuperclass();
        if (genericSuperclass instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) genericSuperclass;
            if (parameterizedType.getRawType() == a.class) {
                Type typeA = g.e.b.g0.a.a(parameterizedType.getActualTypeArguments()[0]);
                this.f4166b = typeA;
                this.a = (Class<? super T>) g.e.b.g0.a.f(typeA);
                this.f4167c = typeA.hashCode();
                return;
            }
        } else if (genericSuperclass == a.class) {
            throw new IllegalStateException("TypeToken must be created with a type argument: new TypeToken<...>() {}; When using code shrinkers (ProGuard, R8, ...) make sure that generic signatures are preserved.");
        }
        throw new IllegalStateException("Must only create direct subclasses of TypeToken");
    }

    public final boolean equals(Object obj) {
        return (obj instanceof a) && g.e.b.g0.a.d(this.f4166b, ((a) obj).f4166b);
    }

    public final int hashCode() {
        return this.f4167c;
    }

    public final String toString() {
        return g.e.b.g0.a.j(this.f4166b);
    }

    public a(Type type) {
        Objects.requireNonNull(type);
        Type typeA = g.e.b.g0.a.a(type);
        this.f4166b = typeA;
        this.a = (Class<? super T>) g.e.b.g0.a.f(typeA);
        this.f4167c = typeA.hashCode();
    }
}
