be.objectify.led.util
Class ContractUtils

java.lang.Object
  extended by be.objectify.led.util.ContractUtils

public class ContractUtils
extends Object

Utility methods for asserting contracts.

Author:
Steve Chaloner

Method Summary
static void nonNull(Collection objects, String objectName)
          Checks if objects is null, and if any of its contents are null.
static void nonNull(Object[] objects, String objectName)
          Checks if objects is null, and if any of its contents are null.
static void notNull(Object object, String objectName)
          Checks if object is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

notNull

public static void notNull(Object object,
                           String objectName)
Checks if object is null. An IllegalArgumentException is thrown if it is null.

Parameters:
object - the object
objectName - the name to reference the object by for exception messages

nonNull

public static void nonNull(Object[] objects,
                           String objectName)
Checks if objects is null, and if any of its contents are null. An IllegalArgumentException is thrown if either of these cases are true.

Parameters:
objects - the array of objects
objectName - the name to reference the array by for exception messages

nonNull

public static void nonNull(Collection objects,
                           String objectName)
Checks if objects is null, and if any of its contents are null. An IllegalArgumentException is thrown if either of these cases are true.

Parameters:
objects - the collection of objects
objectName - the name to reference the collection by for exception messages


Copyright © 2010 Objectify. All Rights Reserved.