|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.webdav.internal.kernel.utils.Assert
public class Assert
Assert
is useful for for embedding runtime sanity checks
in code.
The predicate methods all test a condition and throw some
type of unchecked exception if the condition does not hold.
Assertion failure exceptions, like most runtime exceptions, are thrown when something is misbehaving. Assertion failures are invariably unspecified behavior; consequently, clients should never rely on these being thrown (and certainly should not being catching them specifically).
Method Summary | |
---|---|
static boolean |
isLegal(boolean expression)
Asserts that an argument is legal. |
static boolean |
isLegal(boolean expression,
String message)
Asserts that an argument is legal. |
static void |
isNotNull(Object o)
Asserts that the given object is not null . |
static void |
isNotNull(Object o,
String message)
Asserts that the given object is not null . |
static boolean |
isTrue(boolean expression)
Asserts that the given boolean is true . |
static boolean |
isTrue(boolean expression,
String message)
Asserts that the given boolean is true . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isLegal(boolean expression)
true
, an IllegalArgumentException
is thrown.
IllegalArgumentException
- Thrown if the legality test failedpublic static boolean isLegal(boolean expression, String message)
true
, an IllegalArgumentException
is thrown.
The given message is included in that exception, to aid debugging.
IllegalArgumentException
- Thrown if the legality test failedpublic static void isNotNull(Object o)
null
. If this
is not the case, some kind of unchecked exception is thrown.
public static void isNotNull(Object o, String message)
null
. If this
is not the case, some kind of unchecked exception is thrown.
The given message is included in that exception, to aid debugging.
public static boolean isTrue(boolean expression)
true
. If this
is not the case, some kind of unchecked exception is thrown.
public static boolean isTrue(boolean expression, String message)
true
. If this
is not the case, some kind of unchecked exception is thrown.
The given message is included in that exception, to aid debugging.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |