/Users/lyon/j4p/src/utils/Assert.java
|
1 package utils;
2
3 public class Assert {
4
5 static public void notFalse(boolean b)
6 throws IllegalArgumentException {
7
8 if (b == false)
9 throw new IllegalArgumentException(
10 "boolean expression false");
11
12 }
13
14 static public void notNull(Object obj)
15
16 throws IllegalArgumentException {
17
18 if (obj == null)
19
20 throw new IllegalArgumentException("null argument");
21
22 }
23
24
25 static public void notFalse(boolean b, String s)
26
27 throws IllegalArgumentException {
28
29 if (b == false)
30
31 throw new IllegalArgumentException(s);
32
33 }
34
35 static public void notNull(Object obj, String s)
36
37 throws IllegalArgumentException {
38
39 if (obj == null)
40
41 throw new IllegalArgumentException(s);
42
43 }
44
45 }
46
47