|
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.CCSMPre
public class CCSMPre
This class provides simple methods to check preconditions. Please see refer to the package documentation for a discussion of assertions vs preconditions.
Constructor Summary | |
---|---|
CCSMPre()
|
Method Summary | |
---|---|
static void |
fail(java.lang.String message)
Throws a PreconditionException with the provided 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 CCSMPre()
Method Detail |
---|
public static void isTrue(boolean condition, java.lang.String message) throws PreconditionException
true
.
condition
- condition to checkmessage
- exception message
PreconditionException
- if the condition is false
public static void isFalse(boolean condition, java.lang.String message) throws PreconditionException
false
.
condition
- condition to checkmessage
- exception message
PreconditionException
- if the condition is true
public static void isInstanceOf(java.lang.Object object, java.lang.Class<?> clazz)
public static void fail(java.lang.String message) throws PreconditionException
PreconditionException
with the provided message.
PreconditionException
public 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 |