package a.e.a;

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

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

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

    public o(Boolean bool) {
        Objects.requireNonNull(bool);
        this.f4438a = bool;
    }

    public static boolean h(o oVar) {
        Object obj = oVar.f4438a;
        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 // a.e.a.i
    public boolean a() {
        Object obj = this.f4438a;
        return obj instanceof Boolean ? ((Boolean) obj).booleanValue() : Boolean.parseBoolean(f());
    }

    @Override // a.e.a.i
    public int b() {
        return this.f4438a instanceof Number ? g().intValue() : Integer.parseInt(f());
    }

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

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

    public Number g() {
        Object obj = this.f4438a;
        return obj instanceof String ? new a.e.a.w.q((String) this.f4438a) : (Number) obj;
    }

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

    public o(Number number) {
        Objects.requireNonNull(number);
        this.f4438a = number;
    }

    public o(String str) {
        Objects.requireNonNull(str);
        this.f4438a = str;
    }
}
