Package tools
Class Check
java.lang.Object
tools.Check
Common checker. See the next positive tests:
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);
- Since:
- 1.73
- Author:
- Pavel Ponec
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> booleanfirstItem(T value, @Nullable T... array) Method returnstrueif the first item equals thevaluestatic booleanhasLength(@org.jetbrains.annotations.Nullable byte[] array) Checks if the argument is not empty, nornull.static booleanhasLength(@org.jetbrains.annotations.Nullable char[] array) Checks if the argument is not empty, nornull.static booleanhasLength(@Nullable CharSequence value) Checks if the argument is not empty, nornull.static booleanhasLength(@Nullable Collection<?> values) Checks if the argument is not empty, nornull.static booleanChecks if the argument is not empty, nornull.static <T> booleanhasLength(@Nullable T... array) Checks if the argument is not empty, nornull.static booleanisEmpty(@org.jetbrains.annotations.Nullable byte[] array) Checks if the argument is empty ornull.static booleanisEmpty(@org.jetbrains.annotations.Nullable char[] array) Checks if the argument is empty ornull.static booleanisEmpty(@Nullable CharSequence value) Checks if the argument is empty ornull.static booleanisEmpty(@Nullable Collection<?> value) Checks if the argument is empty ornull.static booleanChecks if the argument is empty ornull.static <T> booleanisEmpty(@Nullable T... array) Checks if the argument is empty ornull.
-
Method Details
-
hasLength
public static boolean hasLength(@Nullable @org.jetbrains.annotations.Nullable byte[] array) Checks if the argument is not empty, nornull. -
hasLength
public static boolean hasLength(@Nullable @org.jetbrains.annotations.Nullable char[] array) Checks if the argument is not empty, nornull. -
hasLength
public static <T> boolean hasLength(@Nullable @Nullable T... array) Checks if the argument is not empty, nornull. -
hasLength
Checks if the argument is not empty, nornull. -
hasLength
Checks if the argument is not empty, nornull. -
hasLength
Checks if the argument is not empty, nornull. -
isEmpty
public static boolean isEmpty(@Nullable @org.jetbrains.annotations.Nullable byte[] array) Checks if the argument is empty ornull. -
isEmpty
public static boolean isEmpty(@Nullable @org.jetbrains.annotations.Nullable char[] array) Checks if the argument is empty ornull. -
isEmpty
public static <T> boolean isEmpty(@Nullable @Nullable T... array) Checks if the argument is empty ornull. -
isEmpty
Checks if the argument is empty ornull. -
isEmpty
Checks if the argument is empty ornull. -
isEmpty
Checks if the argument is empty ornull. -
firstItem
public static <T> boolean firstItem(@Nullable T value, @Nullable @Nullable T... array) Method returnstrueif the first item equals thevalue
-