Class Check

java.lang.Object
org.ujorm.tools.Check

public abstract class Check extends Object
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 Type
    Method
    Description
    static <T> boolean
    firstItem(T value, @Nullable T... array)
    Method returns true if the first item equals the value
    static boolean
    hasLength(@org.jetbrains.annotations.Nullable byte[] array)
    Checks if the argument is not empty, nor null.
    static boolean
    hasLength(@org.jetbrains.annotations.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 Collection<?> values)
    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(@Nullable T... array)
    Checks if the argument is not empty, nor null.
    static boolean
    isEmpty(@org.jetbrains.annotations.Nullable byte[] array)
    Checks if the argument is empty or null.
    static boolean
    isEmpty(@org.jetbrains.annotations.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 Collection<?> 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(@Nullable T... array)
    Checks if the argument is empty or null.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • hasLength

      public static boolean hasLength(@Nullable @org.jetbrains.annotations.Nullable byte[] array)
      Checks if the argument is not empty, nor null.
    • hasLength

      public static boolean hasLength(@Nullable @org.jetbrains.annotations.Nullable char[] array)
      Checks if the argument is not empty, nor null.
    • hasLength

      public static <T> boolean hasLength(@Nullable @Nullable T... array)
      Checks if the argument is not empty, nor null.
    • hasLength

      public static boolean hasLength(@Nullable @Nullable Collection<?> values)
      Checks if the argument is not empty, nor null.
    • hasLength

      public static boolean hasLength(@Nullable @Nullable Map<?,?> values)
      Checks if the argument is not empty, nor null.
    • hasLength

      public static boolean hasLength(@Nullable @Nullable CharSequence value)
      Checks if the argument is not empty, nor null.
    • isEmpty

      public static boolean isEmpty(@Nullable @org.jetbrains.annotations.Nullable byte[] array)
      Checks if the argument is empty or null.
    • isEmpty

      public static boolean isEmpty(@Nullable @org.jetbrains.annotations.Nullable char[] array)
      Checks if the argument is empty or null.
    • isEmpty

      public static <T> boolean isEmpty(@Nullable @Nullable T... array)
      Checks if the argument is empty or null.
    • isEmpty

      public static boolean isEmpty(@Nullable @Nullable Collection<?> value)
      Checks if the argument is empty or null.
    • isEmpty

      public static boolean isEmpty(@Nullable @Nullable Map<?,?> value)
      Checks if the argument is empty or null.
    • isEmpty

      public static boolean isEmpty(@Nullable @Nullable CharSequence value)
      Checks if the argument is empty or null.
    • firstItem

      public static <T> boolean firstItem(@Nullable T value, @Nullable @Nullable T... array)
      Method returns true if the first item equals the value