public final class Validate extends Object
Validation utility
| Modifier and Type | Method and Description |
|---|---|
static void |
configurationDirectoryExists(String string,
String message)
Checks that string is not null and not empty and it represents a path to a valid directory
|
static void |
isInRange(int value,
int bottom,
int top,
String message)
Checks if value lies in an interval (exclusive)
|
static void |
isInReadableDirectory(String path,
String message) |
static boolean |
isNotNullOrEmpty(String string)
Checks that the specified String is not null or empty.
|
static void |
isValidFile(String path,
String message)
Checks that path represents a valid file
|
static void |
notNull(Object obj,
String message)
Checks that object is not null, throws exception if it is.
|
static void |
notNullOrEmpty(String string,
String message)
Checks that the specified String is not null or empty, throws exception if it is.
|
static void |
stateNotNull(Object obj,
String message)
Checks that obj is not null, 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 notNullOrEmpty(String string, String message) throws IllegalArgumentException
string - The object to checkmessage - The exception messageIllegalArgumentException - Thrown if obj is nullpublic static boolean isNotNullOrEmpty(String string) throws IllegalArgumentException
string - The object to checktrue if string is not empty, false otherwiseIllegalArgumentExceptionpublic static void stateNotNull(Object obj, String message) throws IllegalStateException
obj - The object to checkmessage - The exception messageIllegalStateException - Thrown if obj is nullpublic static void isValidFile(String path, String message) throws IllegalArgumentException
path - The path to filemessage - The exception messageIllegalArgumentException - Throws if given file does not exist or if it cannot be readpublic static void configurationDirectoryExists(String string, String message) throws org.jboss.arquillian.container.spi.ConfigurationException
string - The path to checkmessage - The exception messageorg.jboss.arquillian.container.spi.ConfigurationException - Thrown if string is empty, null or it does not represent a path the a valid directorypublic static void isInRange(int value,
int bottom,
int top,
String message)
throws IllegalArgumentException
value - the valuebottom - the bottom boundarytop - the top boundarymessage - the exception messageIllegalArgumentException - Thrown if value does not lie in the intervalpublic static void isInReadableDirectory(String path, String message) throws IllegalArgumentException
IllegalArgumentExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.