package c.b.a;

import java.math.BigInteger;
import java.util.Objects;

/* JADX INFO: loaded from: classes.dex */
public final class n extends i {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Object f1328a;

    public n(Boolean bool) {
        Objects.requireNonNull(bool);
        this.f1328a = bool;
    }

    public static boolean g(n nVar) {
        Object obj = nVar.f1328a;
        if (obj instanceof Number) {
            Number number = (Number) obj;
            if ((number instanceof BigInteger) || (number instanceof Long) || (number instanceof Integer) || (number instanceof Short) || (number instanceof Byte)) {
                return true;
            }
        }
        return false;
    }

    @Override // c.b.a.i
    public String d() {
        Object obj = this.f1328a;
        return obj instanceof Number ? f().toString() : obj instanceof Boolean ? ((Boolean) obj).toString() : (String) obj;
    }

    public boolean e() {
        Object obj = this.f1328a;
        return obj instanceof Boolean ? ((Boolean) obj).booleanValue() : Boolean.parseBoolean(d());
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || n.class != obj.getClass()) {
            return false;
        }
        n nVar = (n) obj;
        if (this.f1328a == null) {
            return nVar.f1328a == null;
        }
        if (g(this) && g(nVar)) {
            return f().longValue() == nVar.f().longValue();
        }
        Object obj2 = this.f1328a;
        if (!(obj2 instanceof Number) || !(nVar.f1328a instanceof Number)) {
            return obj2.equals(nVar.f1328a);
        }
        double dDoubleValue = f().doubleValue();
        double dDoubleValue2 = nVar.f().doubleValue();
        if (dDoubleValue != dDoubleValue2) {
            return Double.isNaN(dDoubleValue) && Double.isNaN(dDoubleValue2);
        }
        return true;
    }

    public Number f() {
        Object obj = this.f1328a;
        return obj instanceof String ? new c.b.a.u.q((String) this.f1328a) : (Number) obj;
    }

    public int hashCode() {
        long jDoubleToLongBits;
        if (this.f1328a == null) {
            return 31;
        }
        if (g(this)) {
            jDoubleToLongBits = f().longValue();
        } else {
            Object obj = this.f1328a;
            if (!(obj instanceof Number)) {
                return obj.hashCode();
            }
            jDoubleToLongBits = Double.doubleToLongBits(f().doubleValue());
        }
        return (int) ((jDoubleToLongBits >>> 32) ^ jDoubleToLongBits);
    }

    public n(Number number) {
        Objects.requireNonNull(number);
        this.f1328a = number;
    }

    public n(String str) {
        Objects.requireNonNull(str);
        this.f1328a = str;
    }
}
