public final class Utils
extends java.lang.Object
构造器和说明 |
---|
Utils() |
限定符和类型 | 方法和说明 |
---|---|
static boolean |
hasText(java.lang.String str)
Check whether the given
String contains actual text. |
static boolean |
isBlank(java.lang.String str) |
static boolean |
isEmpty(java.util.Collection<?> collection)
Return
true if the supplied Collection is null or empty. |
static boolean |
isEmpty(java.util.Map<?,?> map)
Return
true if the supplied Map is null or empty. |
static <T> java.util.concurrent.CompletableFuture<T> |
toCompletableFuture(java.util.concurrent.Future<T> future) |
static java.util.concurrent.CompletableFuture<java.lang.Void> |
toCompletableFutureDiscard(java.util.concurrent.Future<?> future) |
public static boolean hasText(@Nullable java.lang.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(java.lang.String str)
public static boolean isEmpty(@Nullable java.util.Collection<?> collection)
true
if the supplied Collection is null
or empty. Otherwise,
return false
.collection
- the Collection to checkpublic static boolean isEmpty(@Nullable java.util.Map<?,?> map)
true
if the supplied Map is null
or empty. Otherwise, return
false
.map
- the Map to checkpublic static <T> java.util.concurrent.CompletableFuture<T> toCompletableFuture(java.util.concurrent.Future<T> future)
public static java.util.concurrent.CompletableFuture<java.lang.Void> toCompletableFutureDiscard(java.util.concurrent.Future<?> future)