com.atlassian.sal.core.util
Class Assert
java.lang.Object
com.atlassian.sal.core.util.Assert
public class Assert
- extends Object
|
Method Summary |
static
|
notNull(T reference)
Check that reference is not null. |
static
|
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 |
Assert
public Assert()
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 noterrorMessage - 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 © 2010 Atlassian. All Rights Reserved.