|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.tum.cs.commons.assertion.CCSMAssert
public class CCSMAssert
This class provides simple methods to implement assertions. Please refer to the package documentation for a discussion of assertions vs preconditions.
Constructor Summary | |
---|---|
CCSMAssert()
|
Method Summary | |
---|---|
static void |
fail(java.lang.String message)
|
static void |
isFalse(boolean condition,
java.lang.String message)
Checks if a condition is false . |
static void |
isInstanceOf(java.lang.Object object,
java.lang.Class<?> clazz)
Checks that the object is a instance of the class |
static void |
isNotNull(java.lang.Object reference)
Checks whether a reference is null . |
static void |
isNotNull(java.lang.Object reference,
java.lang.String message)
Checks whether a reference is null . |
static void |
isTrue(boolean condition,
java.lang.String message)
Checks if a condition is true . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CCSMAssert()
Method Detail |
---|
public static void isTrue(boolean condition, java.lang.String message) throws java.lang.AssertionError
true
.
condition
- condition to checkmessage
- exception message
java.lang.AssertionError
- if the condition if false
public static void isFalse(boolean condition, java.lang.String message) throws java.lang.AssertionError
false
.
condition
- condition to checkmessage
- exception message
java.lang.AssertionError
- if the condition if true
public static void isInstanceOf(java.lang.Object object, java.lang.Class<?> clazz)
public static void fail(java.lang.String message) throws java.lang.AssertionError
java.lang.AssertionError
- with messagepublic static void isNotNull(java.lang.Object reference) throws java.lang.AssertionError
null
.
reference
- reference to check
java.lang.AssertionError
- if the reference is null
public static void isNotNull(java.lang.Object reference, java.lang.String message) throws java.lang.AssertionError
null
.
reference
- reference to checkmessage
- exception message
java.lang.AssertionError
- if the reference is null
|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |