All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.nav.common.utils.AssertUtils Maven / Gradle / Ivy

package no.nav.common.utils;

public class AssertUtils {

    public static  T assertNotNull(T object) {
        return assertNotNull(object, null);
    }

    public static  T assertNotNull(T object, String errorMessage) {
        if (object == null) {
            throw new IllegalStateException(errorMessage);
        }
        return object;
    }

    public static boolean assertTrue(boolean bool) {
        if (!bool) {
            throw new IllegalStateException();
        }
        return bool;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy