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

com.onelogin.saml2.util.Preconditions Maven / Gradle / Ivy

There is a newer version: 2.9.0
Show newest version
package com.onelogin.saml2.util;

public final class Preconditions {
    /**
     * Throws a NullPointerException if {@code t} is null.
     *
     * @param t       the value to check for null
     * @param message the message to include in the thrown exception
     *
     * @return T 
     *
     * @throws NullPointerException if {@code t} is null
     */
    public static T checkNotNull(T t, String message) {
        if (t == null) {
            throw new NullPointerException(message);
        } else {
            return t;
        }
    }

    private Preconditions() {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy