OCPsoft Common API 1.0.5.Final

org.ocpsoft.common.util
Class Assert

java.lang.Object
  extended by org.ocpsoft.common.util.Assert

public final class Assert
extends Object

Utility methods for making precondition/postcondition assertions.

Author:
Lincoln Baxter, III

Method Summary
static void assertFalse(boolean value, String message)
          Throw an exception if the given value is not false.
static void assertTrue(boolean value, String message)
          Throw an exception if the given value is not true.
static void isNull(Object object, String message)
          Throw an exception if the given Object is not null.
static void notNull(Object object, String message)
          Throw an exception if the given Object is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNull

public static void isNull(Object object,
                          String message)
                   throws IllegalArgumentException
Throw an exception if the given Object is not null.

Throws:
IllegalArgumentException

notNull

public static void notNull(Object object,
                           String message)
                    throws IllegalArgumentException
Throw an exception if the given Object is null.

Throws:
IllegalArgumentException

assertTrue

public static void assertTrue(boolean value,
                              String message)
                       throws IllegalArgumentException
Throw an exception if the given value is not true.

Throws:
IllegalArgumentException

assertFalse

public static void assertFalse(boolean value,
                               String message)
                        throws IllegalArgumentException
Throw an exception if the given value is not false.

Throws:
IllegalArgumentException

OCPsoft Common API 1.0.5.Final

Copyright © 2012 OCPsoft. All Rights Reserved.