public abstract class Check extends Object
Check.hasLength("ABC"); Check.hasLength(new char[]{'A', 'B', 'C'}); Check.hasLength(new StringBuilder().append("ABC")); Check.hasLength(Arrays.asList("A", "B", "C")); Check.isEmpty(""); Check.isEmpty(new char[0]); Check.isEmpty(new StringBuilder()); Check.isEmpty((List) null);
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
firstItem(T value,
T... array)
Method returns
true if the first item equals the value |
static boolean |
hasLength(byte[] array)
Checks if the argument is not empty, nor
null . |
static boolean |
hasLength(Collection<?> values)
Checks if the argument is not empty, nor
null . |
static boolean |
hasLength(char[] array)
Checks if the argument is not empty, nor
null . |
static boolean |
hasLength(CharSequence value)
Checks if the argument is not empty, nor
null . |
static boolean |
hasLength(Map<?,?> values)
Checks if the argument is not empty, nor
null . |
static <T> boolean |
hasLength(T... array)
Checks if the argument is not empty, nor
null . |
static boolean |
isEmpty(byte[] array)
Checks if the argument is empty or
null . |
static boolean |
isEmpty(Collection<?> value)
Checks if the argument is empty or
null . |
static boolean |
isEmpty(char[] array)
Checks if the argument is empty or
null . |
static boolean |
isEmpty(CharSequence value)
Checks if the argument is empty or
null . |
static boolean |
isEmpty(Map<?,?> value)
Checks if the argument is empty or
null . |
static <T> boolean |
isEmpty(T... array)
Checks if the argument is empty or
null . |
public static boolean hasLength(@Nullable byte[] array)
null
.public static boolean hasLength(@Nullable char[] array)
null
.public static <T> boolean hasLength(@Nullable T... array)
null
.public static boolean hasLength(@Nullable Collection<?> values)
null
.public static boolean hasLength(@Nullable Map<?,?> values)
null
.public static boolean hasLength(@Nullable CharSequence value)
null
.public static boolean isEmpty(@Nullable byte[] array)
null
.public static boolean isEmpty(@Nullable char[] array)
null
.public static <T> boolean isEmpty(@Nullable T... array)
null
.public static boolean isEmpty(@Nullable Collection<?> value)
null
.public static boolean isEmpty(@Nullable Map<?,?> value)
null
.public static boolean isEmpty(@Nullable CharSequence value)
null
.Copyright 2019-2022, Pavel Ponec