patterntesting.runtime.util
Class AssertArg

Package class diagram package AssertArg
java.lang.Object
  extended by patterntesting.runtime.util.AssertArg

public abstract class AssertArg
extends Object

This utility class is intended to check arguments. It is like the Assert class in Springframework and throws an IllegalArgumentException 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)

Constructor Summary
AssertArg()
           
 
Method Summary
static void isValid(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssertArg

public AssertArg()
Method Detail

isValid

public static void isValid(javax.validation.Validator validatable)
Checks if the argument is valid. If not (or if is null) an IllegalArgumentException will be thrown.

Parameters:
validatable - the validatable argument

isValid

public static void isValid(Object argument,
                           javax.validation.Validator validator)
Checks if the argument is valid. If not (or if is null) an IllegalArgumentException will be thrown.

Parameters:
argument - the argument
validator - the validator


Copyright © 2002–2014 PatternTesting Team. All rights reserved.