Java Assert Not Null assertNotNull(Object obj)

Here you can find the source of assertNotNull(Object obj)

Description

Method assertNotNull.

License

Open Source License

Parameter

Parameter Description
obj Object

Declaration

public final static void assertNotNull(Object obj) 

Method Source Code

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

public class Main {
    /**//from w  w  w.j  ava 2 s .  c  om
     * Method assertNotNull.
     * 
     * @param obj
     *            Object
     */
    public final static void assertNotNull(Object obj) {
        if (obj == null) {
            throw new RuntimeException("assertion: must not be null");
        }
    }
}

Related

  1. assertNotNull(final T value, final String param)
  2. assertNotNull(Object argumentThatMustNotBeNull, String argumentName)
  3. assertNotNull(Object expression)
  4. assertNotNull(Object o)
  5. assertNotNull(Object obj)
  6. assertNotNull(Object obj, RuntimeException ex)
  7. assertNotNull(Object obj, String msgTemplate, Object... params)
  8. assertNotNull(Object obj, String name)
  9. assertNotNull(Object obj, String name)