org.jruby.util
Class Asserts

java.lang.Object
  extended byorg.jruby.util.Asserts

public final class Asserts
extends java.lang.Object

Debugging util class to terminate the application if the assertion fails. The methods can be turned off in final releases of code by setting ENABLE_ASSERT to false.

Author:
jpetersen

Constructor Summary
Asserts()
           
 
Method Summary
static void isTrue(boolean condition)
          If the assertion fails (i.e.
static void isTrue(boolean condition, java.lang.String message)
           
static void notNull(java.lang.Object object)
          If the assertion fails (i.e.
static void notNull(java.lang.Object object, java.lang.String message)
          If the assertion fails (i.e.
static void notReached()
          If the assertion fails (i.e.
static void notReached(java.lang.String message)
          If the assertion fails (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Asserts

public Asserts()
Method Detail

isTrue

public static void isTrue(boolean condition)
If the assertion fails (i.e. the expression is not true), an error message is logged and the application is terminated.


isTrue

public static void isTrue(boolean condition,
                          java.lang.String message)

notReached

public static void notReached()
If the assertion fails (i.e. the method is invoked), an error message is logged and the application is terminated.


notReached

public static void notReached(java.lang.String message)
If the assertion fails (i.e. the method is invoked), the message is logged and the application is terminated.


notNull

public static void notNull(java.lang.Object object,
                           java.lang.String message)
If the assertion fails (i.e. the object is null), an error message is logged and the application is terminated.


notNull

public static void notNull(java.lang.Object object)
If the assertion fails (i.e. the object is null), an error message is logged and the application is terminated.



Copyright © 2002 Jan Arne Petersen. All Rights Reserved.