package androidx.datastore.preferences.protobuf;

import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final class r implements J {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final r f8136b = new r(0);

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f8137a;

    public /* synthetic */ r(int i) {
        this.f8137a = i;
    }

    @Override // androidx.datastore.preferences.protobuf.J
    public final boolean a(Class cls) {
        switch (this.f8137a) {
            case u0.f15495q /* 0 */:
                return AbstractC0442u.class.isAssignableFrom(cls);
            default:
                return false;
        }
    }

    @Override // androidx.datastore.preferences.protobuf.J
    public final T b(Class cls) {
        switch (this.f8137a) {
            case u0.f15495q /* 0 */:
                if (!AbstractC0442u.class.isAssignableFrom(cls)) {
                    throw new IllegalArgumentException("Unsupported message type: ".concat(cls.getName()));
                }
                try {
                    return (T) AbstractC0442u.d(cls.asSubclass(AbstractC0442u.class)).c(3);
                } catch (Exception e8) {
                    throw new RuntimeException("Unable to get message info for ".concat(cls.getName()), e8);
                }
            default:
                throw new IllegalStateException("This should never be called.");
        }
    }
}
