package j.v0;

import j.p0.d.r;

/* JADX INFO: compiled from: DurationUnit.kt */
/* JADX INFO: loaded from: classes.dex */
class f extends e {
    public static final d d(char c, boolean z) {
        if (!z) {
            if (c == 'D') {
                return d.DAYS;
            }
            throw new IllegalArgumentException("Invalid or unsupported duration ISO non-time unit: " + c);
        }
        if (c == 'H') {
            return d.HOURS;
        }
        if (c == 'M') {
            return d.MINUTES;
        }
        if (c == 'S') {
            return d.SECONDS;
        }
        throw new IllegalArgumentException("Invalid duration ISO time unit: " + c);
    }

    public static final d e(String str) {
        r.f(str, "shortName");
        int iHashCode = str.hashCode();
        if (iHashCode != 100) {
            if (iHashCode != 104) {
                if (iHashCode != 109) {
                    if (iHashCode != 115) {
                        if (iHashCode != 3494) {
                            if (iHashCode != 3525) {
                                if (iHashCode == 3742 && str.equals("us")) {
                                    return d.MICROSECONDS;
                                }
                            } else if (str.equals("ns")) {
                                return d.NANOSECONDS;
                            }
                        } else if (str.equals("ms")) {
                            return d.MILLISECONDS;
                        }
                    } else if (str.equals("s")) {
                        return d.SECONDS;
                    }
                } else if (str.equals("m")) {
                    return d.MINUTES;
                }
            } else if (str.equals("h")) {
                return d.HOURS;
            }
        } else if (str.equals("d")) {
            return d.DAYS;
        }
        throw new IllegalArgumentException("Unknown duration unit short name: " + str);
    }
}
