open static fun hasLength(@Nullable text: String, message: String): Unit
Assert that the given String is not empty; that is, it must not be null and not the empty String.
Assert.hasLength(name, "Name must not be empty");
message - the exception message to use if the assertion fails
IllegalArgumentException - if the text is empty
See Also
StringUtils#hasLength
open static fun hasLength(@Nullable text: String, messageSupplier: Supplier<String>): Unit
Assert that the given String is not empty; that is, it must not be null and not the empty String.
Assert.hasLength(name, () -> "Name for account '" + account.getId() + "' must not be empty");
messageSupplier - a supplier for the exception message to use if the assertion fails
IllegalArgumentException - if the text is empty
See Also
StringUtils#hasLength
Since
5.0
open static fun hasLength(@Nullable text: String): Unit