|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ant4eclipse.lang.Assert
public class Assert
Implements utility methods to support design-by-contract. If a condition is evaluated to false, a RuntimeException will be thrown.
Constructor Summary | |
---|---|
Assert()
|
Method Summary | |
---|---|
static void |
assertTrue(boolean condition,
java.lang.String msg)
Assert that the given condition is true |
static void |
exists(java.io.File file)
Assert that the specified file is not null and exists. |
static void |
inRange(int value,
int from,
int to)
Checks whether a value is in a specific range or not. |
static void |
isDirectory(java.io.File file)
Assert that the specified file is not null, exists and is a directory. |
static void |
isFile(java.io.File file)
Assert that the specified file is not null, exists and is a file. |
static void |
nonEmpty(java.lang.String string)
Assert that the supplied string provides a value or not. |
static void |
notNull(java.lang.Object object)
Assert that the specified object is not null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Assert()
Method Detail |
---|
public static void notNull(java.lang.Object object)
Assert that the specified object is not null.
object
- the object that must be set.public static void nonEmpty(java.lang.String string)
Assert that the supplied string provides a value or not.
string
- the string that must provide a value.public static void exists(java.io.File file)
Assert that the specified file is not null and exists.
file
- the file that must exist.public static void isFile(java.io.File file)
Assert that the specified file is not null, exists and is a file.
file
- the file that must be a file.public static void isDirectory(java.io.File file)
Assert that the specified file is not null, exists and is a directory.
file
- the file that must be a directory.public static void assertTrue(boolean condition, java.lang.String msg)
Assert that the given condition is true
condition
- the conditionmsg
- the messagepublic static void inRange(int value, int from, int to)
Checks whether a value is in a specific range or not.
value
- the value that shall be tested.from
- the lower bound inclusive.to
- the upper bound inclusive.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |