1 package com.github.dexecutor.executor.support;
2
3 /**
4 * Support class to check for preconditions
5 *
6 * @author Nadeem Mohammad
7 *
8 */
9 public final class Preconditions {
10
11 private Preconditions() {
12
13 }
14
15 /**
16 * Checks if the reference is null, and if that is the case throws IllegalArgumentException
17 * @param reference
18 * @param msg
19 * @throws IllegalArgumentException if the reference is null
20 */
21 public static <T> void checkNotNull(T reference, String msg) {
22 if (reference == null) {
23 throw new IllegalArgumentException(msg);
24 }
25 }
26 }