org.ow2.petals.registry.api.util
Class Assert

java.lang.Object
  extended by org.ow2.petals.registry.api.util.Assert

public abstract class Assert
extends java.lang.Object

Author:
Christophe HAMERLING - eBM WebSourcing

Constructor Summary
Assert()
           
 
Method Summary
static void isNull(java.lang.Object object)
          Assert that an object is null .
static void isNull(java.lang.Object object, java.lang.String message)
          Assert that an object is null .
static void isTrue(boolean expression)
          Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
static void isTrue(boolean expression, java.lang.String message)
          Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
static void notNull(java.lang.Object object)
          Assert that an object is not null .
static void notNull(java.lang.Object object, java.lang.String message)
          Assert that an object is not null .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Assert

public Assert()
Method Detail

isTrue

public static void isTrue(boolean expression,
                          java.lang.String message)
Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
 Assert.isTrue(i > 0, "The value must be greater than zero");
 

Parameters:
expression - a boolean expression
message - the exception message to use if the assertion fails
Throws:
java.lang.IllegalArgumentException - if expression is false

isTrue

public static void isTrue(boolean expression)
Assert a boolean expression, throwing IllegalArgumentException if the test result is false.
 Assert.isTrue(i > 0);
 

Parameters:
expression - a boolean expression
Throws:
java.lang.IllegalArgumentException - if expression is false

isNull

public static void isNull(java.lang.Object object,
                          java.lang.String message)
Assert that an object is null .
 Assert.isNull(value, "The value must be null");
 

Parameters:
object - the object to check
message - the exception message to use if the assertion fails
Throws:
java.lang.IllegalArgumentException - if the object is not null

isNull

public static void isNull(java.lang.Object object)
Assert that an object is null .
 Assert.isNull(value);
 

Parameters:
object - the object to check
Throws:
java.lang.IllegalArgumentException - if the object is not null

notNull

public static void notNull(java.lang.Object object,
                           java.lang.String message)
Assert that an object is not null .
 Assert.notNull(clazz, "The class must not be null");
 

Parameters:
object - the object to check
message - the exception message to use if the assertion fails
Throws:
java.lang.IllegalArgumentException - if the object is null

notNull

public static void notNull(java.lang.Object object)
Assert that an object is not null .
 Assert.notNull(clazz);
 

Parameters:
object - the object to check
Throws:
java.lang.IllegalArgumentException - if the object is null


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.