org.gillius.Util
Class CheckUtils

java.lang.Object
  extended by org.gillius.Util.CheckUtils

public class CheckUtils
extends java.lang.Object

CheckUtils provides utitilies for precondition checking.


Constructor Summary
CheckUtils()
           
 
Method Summary
static void checkNull(java.lang.Object parameter, java.lang.String paramName)
          Checks if the given parameter is null, and if so throws an IllegalArgumentException with an appropriate message.
static void checkSize(java.util.Collection c, java.lang.String paramName, int size)
          Checks if the given parameter is null or has a size less than the given size, and if so, throws an IllegalArgumentException with an appropriate message.
static void checkSize(java.lang.Object[] arr, java.lang.String paramName, int size)
          Checks if the given parameter is null or has a size less than the given size, and if so, throws an IllegalArgumentException with an appropriate message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckUtils

public CheckUtils()
Method Detail

checkNull

public static void checkNull(java.lang.Object parameter,
                             java.lang.String paramName)
                      throws java.lang.IllegalArgumentException
Checks if the given parameter is null, and if so throws an IllegalArgumentException with an appropriate message.

Throws:
java.lang.IllegalArgumentException

checkSize

public static void checkSize(java.util.Collection c,
                             java.lang.String paramName,
                             int size)
Checks if the given parameter is null or has a size less than the given size, and if so, throws an IllegalArgumentException with an appropriate message.


checkSize

public static void checkSize(java.lang.Object[] arr,
                             java.lang.String paramName,
                             int size)
Checks if the given parameter is null or has a size less than the given size, and if so, throws an IllegalArgumentException with an appropriate message.