package com.google.firebase.firestore.util;

import java.util.Locale;

/* JADX INFO: loaded from: classes3.dex */
public class Preconditions {
    public static void checkArgument(boolean z6, String str, Object... objArr) {
        if (!z6) {
            throw new IllegalArgumentException(String.format(str, objArr));
        }
    }

    public static <T> T checkNotNull(T t6) {
        t6.getClass();
        return t6;
    }

    public static void checkState(boolean z6) {
        if (!z6) {
            throw new IllegalStateException();
        }
    }

    public static <T> T checkNotNull(T t6, Object obj) {
        if (t6 != null) {
            return t6;
        }
        throw new NullPointerException(String.valueOf(obj));
    }

    public static void checkState(boolean z6, String str) {
        if (!z6) {
            throw new IllegalStateException(str);
        }
    }

    public static <T> T checkNotNull(T t6, String str, Object... objArr) {
        if (t6 != null) {
            return t6;
        }
        throw new NullPointerException(String.format(Locale.US, str, objArr));
    }
}
