KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > terracotta > session > util > Assert


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.terracotta.session.util;
5
6 public class Assert {
7
8   public static void pre(boolean v) {
9     if (!v) throw new AssertionError JavaDoc("Precondition Failed");
10   }
11
12   public static void post(boolean v) {
13     if (!v) throw new AssertionError JavaDoc("Postcondition Failed");
14   }
15
16   public static void inv(boolean v) {
17     if (!v) throw new AssertionError JavaDoc("Invariant Failed");
18   }
19
20 }
21
Popular Tags