NotNull
This utility class provides methods for verifying that objects are not null. It's a simple helper to enforce non-null constraints and throw NullPointerExceptions when necessary.
Methods
isAnythingNull(Object... objects)
Checks if any of the provided objects in the objects array are null.
objects: A variable-length argument list of objects to check.
Returns true if at least one object is null, false otherwise.
isNothingNull(Object... objects)
Checks if none of the provided objects in the objects array are null. This is the logical inverse of isAnythingNull().
objects: A variable-length argument list of objects to check.
Returns true if all objects are non-null, false otherwise.
throwExceptionIfNull(String message, Object... objects)
Throws a NullPointerException with the specified message if any of the provided objects are null.
message: The detail message for theNullPointerExceptionif it is thrown.objects: A variable-length argument list of objects to check for nullity.