java.lang.Object
org.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 $)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Assertions
public Assertions()
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
.