com.atlassian.user.util
Class Assert

java.lang.Object
  extended bycom.atlassian.user.util.Assert

public class Assert
extends java.lang.Object


Constructor Summary
Assert()
           
 
Method Summary
static void isInstanceOf(java.lang.Class clazz, java.lang.Object object)
          Assert that the provided object is an instance of the provided class, throwing an IllegalArgumentException if is it not.
static void isInstanceOf(java.lang.Class clazz, java.lang.Object object, java.lang.String message)
          Assert that the provided object is an instance of the provided class, throwing an IllegalArgumentException if is it not.
static void isTrue(boolean expression, java.lang.String message)
          Asserts that an expression is true, throwing an IllegalArgumentException if it is false.
static void notNull(java.lang.Object object, java.lang.String message)
          Assert that an object is not null, throwing IllegalArgumentException if it is.
 
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

notNull

public static void notNull(java.lang.Object object,
                           java.lang.String message)
Assert that an object is not null, throwing IllegalArgumentException if it is.

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

isTrue

public static void isTrue(boolean expression,
                          java.lang.String message)
Asserts that an expression is true, throwing an IllegalArgumentException if it is false.

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

isInstanceOf

public static void isInstanceOf(java.lang.Class clazz,
                                java.lang.Object object)
Assert that the provided object is an instance of the provided class, throwing an IllegalArgumentException if is it not.

Parameters:
clazz - the required class
object - the object to check
Throws:
java.lang.IllegalArgumentException - if the object is not an instance of clazz

isInstanceOf

public static void isInstanceOf(java.lang.Class clazz,
                                java.lang.Object object,
                                java.lang.String message)
Assert that the provided object is an instance of the provided class, throwing an IllegalArgumentException if is it not.

Parameters:
clazz - the required class
object - the object to check
message - the exception message to use if the assertion fails
Throws:
java.lang.IllegalArgumentException - if the object is not an instance of clazz


Copyright © 2005-2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.