public class Validation extends Object
| Modifier and Type | Method and Description |
|---|---|
static <X extends Exception> |
otherwiseThrowing(Class<X> exceptionClass) |
static <X extends Exception> |
validate(boolean condition,
Class<X> exceptionClass)
Validate the boolean expression that is supposed to be true.
|
static <X extends Exception> |
validate(boolean condition,
ExceptionFactory<X> factory)
Validate the boolean expression that is supposed to be true.
|
static <X extends Exception> |
validate(boolean condition,
X exception)
Validate the boolean expression that is supposed to be true.
|
static <T,X extends Exception> |
validate(T o,
org.hamcrest.Matcher<?> matcher,
Class<X> exceptionClass)
Validate the given object that is supposed to satisfy the matcher.
|
static <T,X extends Exception> |
validate(T o,
org.hamcrest.Matcher<?> matcher,
ExceptionFactory<X> factory)
Validate the given object that is supposed to satisfy the matcher.
|
static <T,X extends Exception> |
validate(T o,
org.hamcrest.Matcher<?> matcher,
X exception)
Validate the given object that is supposed to satisfy the matcher.
|
public static <X extends Exception> ExceptionFactory<X> otherwiseThrowing(Class<X> exceptionClass)
public static <X extends Exception> void validate(boolean condition, X exception) throws X extends Exception
X - type of exception to throw if validation failscondition - the condition to validate. Supposed to be true.exception - the recoverable exception to be thrown if validation fails.X - the recoverable exception, if validation failsX extends Exceptionpublic static <X extends Exception> void validate(boolean condition, Class<X> exceptionClass) throws X extends Exception
X - type of exception to throw if validation failscondition - the condition to validate. Supposed to be true.exceptionClass - the class of recoverable exception to be thrown if validation fails.X - the recoverable exception, if validation failsX extends Exceptionpublic static <X extends Exception> void validate(boolean condition, ExceptionFactory<X> factory) throws X extends Exception
X - type of exception to throw if validation failscondition - the condition to validate. Supposed to be true.factory - the factory of recoverable exception to be thrown if validation fails.X - the recoverable exception, if validation failsX extends Exceptionpublic static <T,X extends Exception> T validate(T o, org.hamcrest.Matcher<?> matcher, X exception) throws X extends Exception
T - type of object to validateX - type of exception to throw if validation failso - the object to validatematcher - the matcher that the object must satisfyexception - the recoverable exception to be thrown if validation fails.X - the recoverable exception, if validation failsX extends Exceptionpublic static <T,X extends Exception> T validate(T o, org.hamcrest.Matcher<?> matcher, Class<X> exceptionClass) throws X extends Exception
T - type of object to validateX - type of exception to throw if validation failso - the object to validatematcher - the matcher that the object must satisfyexceptionClass - the class of recoverable exception to be thrown if validation fails.X - the recoverable exception, if validation failsX extends Exceptionpublic static <T,X extends Exception> T validate(T o, org.hamcrest.Matcher<?> matcher, ExceptionFactory<X> factory) throws X extends Exception
T - type of object to validateX - type of exception to throw if validation failso - the object to validatematcher - the matcher that the object must satisfyfactory - the factory of recoverable exception to be thrown if validation fails.X - the recoverable exception, if validation failsX extends ExceptionCopyright © 2014–2015 valid4j. All rights reserved.