public final class Assert
extends java.lang.Object
AssertFailedException when the assertion fails. All methods are static.| Modifier and Type | Method and Description |
|---|---|
static void |
isFalse(boolean condition,
java.lang.String message)
Verify that condition is false.
|
static void |
isNull(java.lang.Object arg,
java.lang.String argName)
Verify that arg is null.
|
static void |
isTrue(boolean condition,
java.lang.String message)
Verify that condition is true.
|
static void |
notNull(java.lang.Object arg,
java.lang.String argName)
Verify that arg is not null.
|
static void |
notNullOrEmpty(java.util.Collection collection,
java.lang.String argName)
Verify that the collection is not null or empty.
|
static void |
notNullOrEmpty(java.util.Map map,
java.lang.String argName)
Verify that the Map is not null or empty.
|
static void |
notNullOrEmpty(java.lang.Object[] array,
java.lang.String argName)
Verify that the array is not null or empty.
|
static void |
notNullOrEmpty(java.lang.String string,
java.lang.String argName)
Verify that the String is not null or empty.
|
public static void isNull(java.lang.Object arg,
java.lang.String argName)
arg - - the method parameter valueargName - - the name of the parameter; used in the exception messageAssertFailedException - - if arg is not nullpublic static void notNull(java.lang.Object arg,
java.lang.String argName)
arg - - the method parameter valueargName - - the name of the parameter; used in the exception messageAssertFailedException - - if arg is nullpublic static void isTrue(boolean condition,
java.lang.String message)
condition - - the condition that should be truemessage - - the error message if the condition is falseAssertFailedException - - if condition is falsepublic static void isFalse(boolean condition,
java.lang.String message)
condition - - the condition that should be falsemessage - - the error message if the condition is trueAssertFailedException - - if condition is truepublic static void notNullOrEmpty(java.util.Collection collection,
java.lang.String argName)
collection - - the CollectionargName - - the name of the parameter; used in the exception messageAssertFailedException - - if collection is null or emptypublic static void notNullOrEmpty(java.util.Map map,
java.lang.String argName)
map - - the MapargName - - the name of the parameter; used in the exception messageAssertFailedException - - if map is null or emptypublic static void notNullOrEmpty(java.lang.Object[] array,
java.lang.String argName)
array - - the arrayargName - - the name of the parameter; used in the exception messageAssertFailedException - - if array is null or emptypublic static void notNullOrEmpty(java.lang.String string,
java.lang.String argName)
string - - the StringargName - - the name of the parameter; used in the exception messageAssertFailedException - - if string is null or empty