1
2
3
4
5
6
7 package com.diasparsoftware.gsbase;
8
9 import com.gargoylesoftware.base.util.DetailedNullPointerException;
10
11 /***
12 * A utility for runtime assertions.
13 *
14 * @version $Revision: 1.1 $
15 * @author <a href="mailto:jbr@diasparsoftware.com">J. B. Rainsberger </a>
16 */
17 public class Assert {
18
19
20 /***
21 * Throws a runtime exception if the specified value is null.
22 *
23 * @param argumentName
24 * The name of the argument you are checking
25 * @param argumentValue
26 * The value of the argument you are checking
27 * @throws DetailedNullPointerException
28 * Thrown if <code>argumentValue</code> is null
29 */
30 public static final void notNull(final String argumentName,
31 final Object argumentValue) {
32
33 if (argumentValue == null) { throw new DetailedNullPointerException(
34 argumentName); }
35 }
36 }