public final class Validate extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
isTrue(boolean val)
Validates that the value is true
|
static void |
isTrue(boolean val,
String msg)
Validates that the value is true
|
static void |
noNullElements(Object[] objects)
Validates that the array contains no null elements
|
static void |
noNullElements(Object[] objects,
String msg)
Validates that the array contains no null elements
|
static void |
notEmpty(String string)
Validates that the string is not empty
|
static void |
notEmpty(String string,
String msg)
Validates that the string is not empty
|
static void |
notNull(Object obj)
Validates that the obect is not null
|
static void |
notNull(Object obj,
String msg)
Validates that the object is not null
|
public static void notNull(Object obj)
obj - object to testpublic static void notNull(Object obj, 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,
String msg)
val - object to testmsg - message to output if validation failspublic static void noNullElements(Object[] objects)
objects - the array to testpublic static void noNullElements(Object[] objects, String msg)
objects - the array to testmsg - message to output if validation failspublic static void notEmpty(String string)
string - the string to testCopyright © 2021. All rights reserved.