public final class Validate extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
isReadable(String path,
String message)
Checks that the specified String is not null or empty and represents
a readable file, throws exception if it is empty or null and does not represent a path
to a file.
|
static void |
notEmpty(Collection<?> collection,
String message)
Checks that collection is not
null or empty, throws exception if it is. |
static void |
notNull(Object obj,
String message)
Checks that object is not null, throws exception if it is.
|
static void |
notNullAndNoNullValues(Object[] objects,
String message)
Checks that the specified array is not null or contain any null values.
|
static void |
notNullOrEmpty(String string,
String message)
Checks that the specified String is not null or empty,
throws exception if it is.
|
public static void notNull(Object obj, String message) throws IllegalArgumentException
obj - The object to checkmessage - The exception messageIllegalArgumentException - Thrown if obj is nullpublic static void notEmpty(Collection<?> collection, String message) throws IllegalArgumentException
null or empty, throws exception if it is.collection - The collection to be checkedmessage - The exception messageIllegalArgumentException - Thrown if collection is null or emptypublic static void notNullOrEmpty(String string, String message) throws IllegalArgumentException
string - The object to checkmessage - The exception messageIllegalArgumentException - Thrown if string is nullpublic static void isReadable(String path, String message) throws IllegalArgumentException
path - The path to checkmessage - The exception messageIllegalArgumentException - Thrown if path is empty, null or invalidCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.