java.lang.Object
is.codion.common.utilities.Nulls
Utility class for working with nulls.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true if none of the given objects are null, false if the array itself is null, and true if no objects are provided.static <C extends Collection<T>,T>
CrejectNulls(@Nullable C items) Throws a NullPointerException if the given collection, or any of its items, is null
-
Method Details
-
nonNull
Returns true if none of the given objects are null, false if the array itself is null, and true if no objects are provided.Use
Objects.nonNull(Object)for single values, to eliminate varargs array creation.- Parameters:
objects- the objects to check- Returns:
- true if none of the given objects are null, false if the array itself is null, true if no objects are provided
-
rejectNulls
Throws a NullPointerException if the given collection, or any of its items, is null- Type Parameters:
C- the collection typeT- the collection element type- Parameters:
items- the items to check for nulls- Returns:
- the items
-