public class Assert extends Object
| Constructor and Description |
|---|
Assert() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
assertNotNull(T object)
Assert not null
|
static <T> T |
assertNotNull(T object,
String format,
Object... args)
Assert not null
|
static <T> T |
assertNotNullWithNPE(T object,
String format,
Object... args)
Assert not null, sending a
NullPointerException if object is null |
static <T> void |
assertNull(T object,
String format,
Object... args)
Assert null
|
static void |
assertTrue(boolean condition,
String format,
Object... args)
Assert given condition is true
|
public static <T> T assertNotNull(T object,
String format,
Object... args)
T - the object typeobject - the object to be testedformat - the message in case of errorargs - arguments for the messagepublic static <T> T assertNotNullWithNPE(T object,
String format,
Object... args)
NullPointerException if object is nullT - the object typeobject - the object to be testedformat - the message in case of errorargs - arguments for the messagepublic static <T> T assertNotNull(T object)
T - the object typeobject - the object to be testedpublic static <T> void assertNull(T object,
String format,
Object... args)
T - the object typeobject - the object to be testedformat - the message in case of errorargs - arguments for the messageCopyright © 2019. All rights reserved.