1 11 package org.eclipse.core.internal.commands.util; 12 13 21 public final class Assert { 22 23 32 public static void isNotNull(Object object) { 33 isNotNull(object, ""); } 35 36 48 public static void isNotNull(Object object, String message) { 49 if (object == null) 50 throw new IllegalArgumentException ("null argument:" + message); } 52 53 63 public static boolean isTrue(boolean expression) { 64 return isTrue(expression, ""); } 66 67 81 public static boolean isTrue(boolean expression, String message) { 82 if (!expression) 83 throw new IllegalArgumentException ("assertion failed:" + message); return expression; 85 } 86 87 private Assert() { 88 } 90 } 91 | Popular Tags |