multex
Class Assertion

java.lang.Object
  |
  +--multex.Assertion

public class Assertion
extends java.lang.Object

Tool for checking unexpected programming errors


Inner Class Summary
static interface Assertion.Failure
          Indicates that an assertion failed.
 
Method Summary
static void check(boolean i_condition, java.lang.String i_name)
          Checks, that i_condition holds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

check

public static void check(boolean i_condition,
                         java.lang.String i_name)
                  throws Assertion.Failure
Checks, that i_condition holds.

Note:

If you want to give diagnostic parameters to an Assertion, you should yourself write the code e.g.
   if(!condition){
     throw new Assertion.Failure(name, stringPar1, new Integer(intPar2));
   }
 
This should not be committed to a check-Method, because creating a new capsule object for each parameter of a primitive type involves to much overhead in non-error cases, too.