Modifier and Type | Method and Description |
---|---|
static <T> T[] |
noNulls(T... array) |
static <T extends Iterable<T>> |
noNulls(T items) |
static <T> T[] |
noNullsNotEmpty(T... array) |
static <T extends Iterable<T>> |
noNullsNotEmpty(T items) |
static <T> T |
notNull(String message,
T obj)
Check that the item is non-null.
|
static <T> T |
notNull(T obj)
Check that the item is non-null.
|
public static <T> T notNull(String message, T obj) throws NullPointerException
T
- the type of the objectmessage
- the message of the exception if thrownobj
- the object to checkNullPointerException
- if the object is nullpublic static <T> T notNull(T obj) throws NullPointerException
T
- the type of the objectobj
- the item to checkNullPointerException
- if the object is nullpublic static <T> T[] noNulls(T... array) throws NullPointerException
T
- the type of the elementsarray
- not null and cannot contain nullNullPointerException
- if the array is null or contains a null
elementpublic static <T extends Iterable<T>> T noNulls(T items) throws NullPointerException
T
- the type of the elementsitems
- not null and cannot contain nullNullPointerException
- if the items is null or contains a null
elementpublic static <T> T[] noNullsNotEmpty(T... array) throws IllegalArgumentException, NullPointerException
T
- the type of the elementsarray
- not null, cannot contain null, and is non-emptyIllegalArgumentException
- if the array is emptyNullPointerException
- if the array is null or contains a null
elementpublic static <T extends Iterable<T>> T noNullsNotEmpty(T items) throws IllegalArgumentException, NullPointerException
T
- the type of the elementsitems
- not null, cannot contain null, and is non-emptyIllegalArgumentException
- if the items is emptyNullPointerException
- if the items is null or contains a null
elementCopyright © 2013. All Rights Reserved.