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

com.jparams.object.builder.util.Assertion Maven / Gradle / Ivy

package com.jparams.object.builder.util;

/**
 * Assertion utility class
 */
public final class Assertion
{
    private Assertion()
    {
    }

    /**
     * Assert given object is not null
     *
     * @param value value to test
     * @param    type
     * @return value
     */
    public static  T ifNotNull(final T value)
    {
        assertNotNull(value);
        return value;
    }

    /**
     * Assert the given value is not null
     *
     * @param value value to test
     */
    public static void assertNotNull(final Object value)
    {
        if (value == null)
        {
            throw new IllegalArgumentException("Unexpected null value");
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy