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(@Nullable byte[] array)
Checks if the argument is not empty, nor
null. |
static boolean |
hasLength(@Nullable Collection<?> values)
Checks if the argument is not empty, nor
null. |
static boolean |
hasLength(@Nullable char[] array)
Checks if the argument is not empty, nor
null. |
static boolean |
hasLength(@Nullable CharSequence value)
Checks if the argument is not empty, nor
null. |
static boolean |
hasLength(@Nullable 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(@Nullable byte[] array)
Checks if the argument is empty or
null. |
static boolean |
isEmpty(@Nullable Collection<?> value)
Checks if the argument is empty or
null. |
static boolean |
isEmpty(@Nullable char[] array)
Checks if the argument is empty or
null. |
static boolean |
isEmpty(@Nullable CharSequence value)
Checks if the argument is empty or
null. |
static boolean |
isEmpty(@Nullable 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
@Nullable byte[] array)
null.public static boolean hasLength(@Nullable
@Nullable char[] array)
null.public static <T> boolean hasLength(@Nullable
T... array)
null.public static boolean hasLength(@Nullable
@Nullable Collection<?> values)
null.public static boolean hasLength(@Nullable
@Nullable Map<?,?> values)
null.public static boolean hasLength(@Nullable
@Nullable CharSequence value)
null.public static boolean isEmpty(@Nullable
@Nullable byte[] array)
null.public static boolean isEmpty(@Nullable
@Nullable char[] array)
null.public static <T> boolean isEmpty(@Nullable
T... array)
null.public static boolean isEmpty(@Nullable
@Nullable Collection<?> value)
null.public static boolean isEmpty(@Nullable
@Nullable Map<?,?> value)
null.public static boolean isEmpty(@Nullable
@Nullable CharSequence value)
null.public static <T> boolean firstItem(@Nullable
T value,
@Nullable
T... array)
true if the first item equals the valueCopyright 2015, Pavel Ponec