Java Assert Not Null assertNotNull(final Object... objects)

Here you can find the source of assertNotNull(final Object... objects)

Description

assert Not Null

License

Open Source License

Parameter

Parameter Description
objects - The list of objects to check.

Return

true if none of the objects is null, false otherwise.

Declaration

public static boolean assertNotNull(final Object... objects) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*ww w.  j av  a2 s  .c  o  m*/
     * @param objects - The list of objects to check.
     * @return <code>true</code> if none of the objects is <code>null</code>,
     *         <code>false</code> otherwise.
     */
    public static boolean assertNotNull(final Object... objects) {
        for (Object obj : objects) {
            if (obj == null) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. assertNotNull(final Object obj, final String reference)
  2. assertNotNull(final Object object, final String message)
  3. assertNotNull(final Object object, final String message)
  4. assertNotNull(final Object param, final String name)
  5. assertNotNull(final Object value, final String name)
  6. assertNotNull(final String message, final Object obj)
  7. assertNotNull(final String message, final Object object)
  8. assertNotNull(final String name, final T object)
  9. assertNotNull(final String param, final Object value)