spring-framework / org.springframework.util / Assert / noNullElements

noNullElements

open static fun noNullElements(@Nullable array: Array<Any>, message: String): Unit

Assert that an array contains no null elements.

Note: Does not complain if the array is empty!

Assert.noNullElements(array, "The array must contain non-null elements");

Parameters

array - the array to check

message - the exception message to use if the assertion fails

Exceptions

IllegalArgumentException - if the object array contains a null element

open static fun noNullElements(@Nullable array: Array<Any>, messageSupplier: Supplier<String>): Unit

Assert that an array contains no null elements.

Note: Does not complain if the array is empty!

 Assert.noNullElements(array, () -> "The " + arrayType + " array must contain non-null elements"); 

Parameters

array - the array to check

messageSupplier - a supplier for the exception message to use if the assertion fails

Exceptions

IllegalArgumentException - if the object array contains a null element

Since
5.0

open static fun noNullElements(@Nullable array: Array<Any>): Unit