public final class Validate
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
fail(java.lang.String msg)
Cause a failure.
|
static void |
isFalse(boolean val)
Validates that the value is false
|
static void |
isFalse(boolean val,
java.lang.String msg)
Validates that the value is false
|
static void |
isTrue(boolean val)
Validates that the value is true
|
static void |
isTrue(boolean val,
java.lang.String msg)
Validates that the value is true
|
static void |
noNullElements(java.lang.Object[] objects)
Validates that the array contains no null elements
|
static void |
noNullElements(java.lang.Object[] objects,
java.lang.String msg)
Validates that the array contains no null elements
|
static void |
notEmpty(java.lang.String string)
Validates that the string is not empty
|
static void |
notEmpty(java.lang.String string,
java.lang.String msg)
Validates that the string is not empty
|
static void |
notNull(java.lang.Object obj)
Validates that the object is not null
|
static void |
notNull(java.lang.Object obj,
java.lang.String msg)
Validates that the object is not null
|
public static void notNull(java.lang.Object obj)
obj
- object to testpublic static void notNull(java.lang.Object obj, java.lang.String msg)
obj
- object to testmsg
- message to output if validation failspublic static void isTrue(boolean val)
val
- object to testpublic static void isTrue(boolean val, java.lang.String msg)
val
- object to testmsg
- message to output if validation failspublic static void isFalse(boolean val)
val
- object to testpublic static void isFalse(boolean val, java.lang.String msg)
val
- object to testmsg
- message to output if validation failspublic static void noNullElements(java.lang.Object[] objects)
objects
- the array to testpublic static void noNullElements(java.lang.Object[] objects, java.lang.String msg)
objects
- the array to testmsg
- message to output if validation failspublic static void notEmpty(java.lang.String string)
string
- the string to testpublic static void notEmpty(java.lang.String string, java.lang.String msg)
string
- the string to testmsg
- message to output if validation failspublic static void fail(java.lang.String msg)
msg
- message to output.