package g.e.b;

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

/* JADX INFO: loaded from: classes.dex */
public final class u extends o {
    public final Object a;

    public u(Boolean bool) {
        Objects.requireNonNull(bool);
        this.a = bool;
    }

    public static boolean f(u uVar) {
        Object obj = uVar.a;
        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 // g.e.b.o
    public boolean a() {
        Object obj = this.a;
        return obj instanceof Boolean ? ((Boolean) obj).booleanValue() : Boolean.parseBoolean(d());
    }

    @Override // g.e.b.o
    public String d() {
        Object obj = this.a;
        return obj instanceof Number ? e().toString() : obj instanceof Boolean ? ((Boolean) obj).toString() : (String) obj;
    }

    public Number e() {
        Object obj = this.a;
        return obj instanceof String ? new g.e.b.g0.v((String) this.a) : (Number) obj;
    }

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

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

    public u(Number number) {
        Objects.requireNonNull(number);
        this.a = number;
    }

    public u(String str) {
        Objects.requireNonNull(str);
        this.a = str;
    }
}
