Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.cantaloop.cgimlet
Class Assertions  view Assertions download Assertions.java

java.lang.Object
  extended byorg.cantaloop.cgimlet.Assertions

public final class Assertions
extends java.lang.Object

This class defines some useful methods to ensure that a certain conditions holds true.

Version:
@version@ ($Revision: 1.3 $)

Constructor Summary
Assertions()
           
 
Method Summary
static void assertContains(java.util.Map map, java.lang.Object key, java.lang.String errorMsg)
          Checks if map contains the given key.
static void assertNotNull(java.lang.Object obj, java.lang.String errorMsg)
          Throws a CodeGenerationException with the given error message if obj == null.
static void assertTrue(boolean condition, java.lang.String errorMsg)
          Throws a CodeGenerationException with the given error message if the boolean parameter condition is false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assertions

public Assertions()
Method Detail

assertTrue

public static final void assertTrue(boolean condition,
                                    java.lang.String errorMsg)
Throws a CodeGenerationException with the given error message if the boolean parameter condition is false.


assertContains

public static final void assertContains(java.util.Map map,
                                        java.lang.Object key,
                                        java.lang.String errorMsg)
Checks if map contains the given key. If the map does not contain the key, a CodeGenerationException is thrown using the specified error message.


assertNotNull

public static final void assertNotNull(java.lang.Object obj,
                                       java.lang.String errorMsg)
Throws a CodeGenerationException with the given error message if obj == null.