Class 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 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)
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(java.lang.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