1 package net.sourceforge.jparam.util;
2
3 public class Utils {
4 private static Class[] debugClasses = new Class[] {};
5
6 public static void assert(boolean cond, String msg) {
7 if (!cond) {
8 System.out.println("Assertion failed: " + msg);
9 throw new RuntimeException("Assertion failed: " + msg);
10 }
11 }
12
13 /***
14 * @param converter
15 * @return
16 */
17 public static boolean isDebugEnabled(Object o) {
18 if (o != null) {
19 for (int i = 0; i < debugClasses.length; i++) {
20 if (debugClasses[i].isInstance(o)) {
21 return true;
22 }
23 }
24 }
25
26 return false;
27 }
28 }