Business Objects
Quark Platform Documentation
Version 1.7.1_0
Business Objects

org.openquark.cal.services
Class Assert

java.lang.Object
  extended by org.openquark.cal.services.Assert

public final class Assert
extends Object

A static helper class which contains various utility methods which can be used to check code preconditions at runtime. These methods throw some sort of unchecked exception if the precondition is not met.

Author:
Edward Lam

Method Summary
static void isNotNull(Object o)
          Assert that an object is not null.
static void isNotNull(Object o, String exceptionText)
          Assert that an object is not null.
static void isNotNullArgument(Object argValue)
          Assert that the value of an argument is not null.
static void isNotNullArgument(Object argValue, String argName)
          Assert that the value of an argument is not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNotNull

public static void isNotNull(Object o)
                      throws NullPointerException
Assert that an object is not null.

Parameters:
o - the object to check
Throws:
NullPointerException - if o is null.

isNotNull

public static void isNotNull(Object o,
                             String exceptionText)
                      throws NullPointerException
Assert that an object is not null.

Parameters:
o - the object to check.
exceptionText - the text of the exception message if the object is null. If null, no exception text is included.
Throws:
NullPointerException - if o is null.

isNotNullArgument

public static void isNotNullArgument(Object argValue)
                              throws NullPointerException
Assert that the value of an argument is not null.

Parameters:
argValue - the value of the argument.
Throws:
NullPointerException - if argValue is null.

isNotNullArgument

public static void isNotNullArgument(Object argValue,
                                     String argName)
                              throws NullPointerException
Assert that the value of an argument is not null.

Parameters:
argValue - the value of the argument.
argName - the name of the argument. If null or an empty string, no argument name is assumed.
Throws:
NullPointerException - if argumentValue is null.

Business Objects
Quark Platform Documentation
Version 1.7.1_0
Business Objects

Copyright © 2007 Business Objects. All rights reserved.