Here you can find the source of assertNotNull(Object obj, String name)
Checks whether the given Object is not null.
Parameter | Description |
---|---|
obj | the argument to check |
name | the name of the argument |
Parameter | Description |
---|---|
IllegalArgumentException | if the given Object(obj) is null |
public static void assertNotNull(Object obj, String name)
//package com.java2s; public class Main { /**// ww w . j a va 2s. c o m * <p> * Checks whether the given Object is not null. * </p> * * @param obj the argument to check * @param name the name of the argument * @throws IllegalArgumentException if the given Object(obj) is null */ public static void assertNotNull(Object obj, String name) { if (obj == null) { throw new IllegalArgumentException("[ " + name + " ] should not be null."); } } }