public final class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
hasText(String str)
Check whether the given
String contains actual text. |
static boolean |
isBlank(String str) |
static boolean |
isEmpty(Collection<?> collection)
Return
true if the supplied Collection is null or empty. |
static boolean |
isEmpty(Map<?,?> map)
Return
true if the supplied Map is null or empty. |
static <T> CompletableFuture<T> |
toCompletableFuture(Future<T> future) |
static CompletableFuture<Void> |
toCompletableFutureDiscard(Future<?> future) |
public static boolean hasText(@Nullable
String str)
String contains actual text.
More specifically, this method returns true if the String is not
null, its length is greater than 0, and it contains at least one
non-whitespace character.
str - the String to check (may be null)true if the String is not null, its length is
greater than 0, and it does not contain whitespace onlyCharacter.isWhitespace(char)public static boolean isBlank(String str)
public static boolean isEmpty(@Nullable
Collection<?> collection)
true if the supplied Collection is null or empty. Otherwise,
return false.collection - the Collection to checkpublic static boolean isEmpty(@Nullable
Map<?,?> map)
true if the supplied Map is null or empty. Otherwise, return
false.map - the Map to checkpublic static <T> CompletableFuture<T> toCompletableFuture(Future<T> future)
public static CompletableFuture<Void> toCompletableFutureDiscard(Future<?> future)
Copyright © 2025. All rights reserved.