Package patterntesting.runtime.util
Class AssertArg
- java.lang.Object
-
- patterntesting.runtime.util.AssertArg
-
public abstract class AssertArg extends java.lang.Object
This utility class is intended to check arguments. It is like the Assert class in Springframework and throws anIllegalArgumentException
if the argument is not valid.This class is abstract to avoid that it is instantiated. There are only static methods so there is no need to instantiate it. This is the same way like the Springframework does it.
For more information about the use of bean validation have a look at Bean Validation with Hibernate Validator framework
.- Since:
- 1.4 (29.11.2013)
- Author:
- oliver (boehm@javatux.de)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
isValid(java.lang.Object argument, javax.validation.Validator validator)
Checks if the argument is valid.static void
isValid(javax.validation.Validator validatable)
Checks if the argument is valid.
-
-
-
Method Detail
-
isValid
public static void isValid(javax.validation.Validator validatable)
Checks if the argument is valid. If not (or if is null) anIllegalArgumentException
will be thrown.- Parameters:
validatable
- the validatable argument
-
isValid
public static void isValid(java.lang.Object argument, javax.validation.Validator validator)
Checks if the argument is valid. If not (or if is null) anIllegalArgumentException
will be thrown.- Parameters:
argument
- the argumentvalidator
- the validator
-
-