com.atlassian.sal.core.util
Class Assert

java.lang.Object
  extended by com.atlassian.sal.core.util.Assert

public class Assert
extends Object


Constructor Summary
Assert()
           
 
Method Summary
static
<T> T
notNull(T reference)
          Check that reference is not null.
static
<T> T
notNull(T reference, Object errorMessage)
          Check that reference 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

notNull

public static <T> T notNull(T reference)
Check that reference is not null. If it is, throw a IllegalArgumentException.

Parameters:
reference - reference to check is null or not
Returns:
reference so it may be used
Throws:
IllegalArgumentException - if reference is null

notNull

public static <T> T notNull(T reference,
                            Object errorMessage)
Check that reference is not null. If it is, throw a IllegalArgumentException.

Parameters:
reference - reference to check is null or not
errorMessage - message passed to the IllegalArgumentException constructor to give more context when debugging
Returns:
reference so it may be used
Throws:
IllegalArgumentException - if reference is null


Copyright © 2011 Atlassian. All Rights Reserved.