Class Assert

java.lang.Object
com.mysema.commons.lang.Assert

public final class Assert extends Object
General assertion utilities
  • Field Details

  • Constructor Details

    • Assert

      private Assert()
  • Method Details

    • hasText

      public static String hasText(String str, String propOrMsg)
      Assert that the given String has actual non-whitepsace text.
      Parameters:
      str -
      propOrMsg -
      Returns:
    • notNull

      public static <T> T notNull(T object, String propOrMsg)
      Assert that the given object is not null
      Type Parameters:
      T -
      Parameters:
      object -
      propOrMsg -
      Returns:
    • hasLength

      public static String hasLength(String str, String propOrMsg)
      Assert that the given String is not empty
      Parameters:
      str -
      propOrMsg -
      Returns:
    • notEmpty

      public static <T> T[] notEmpty(T[] objects, String propOrMsg)
      Assert that the given array is not empty
      Type Parameters:
      T -
      Parameters:
      objects -
      propOrMsg -
      Returns:
    • notEmpty

      public static <M extends Map<?, ?>> M notEmpty(M map, String propOrMsg)
      Assert that the given Map is not empty
      Type Parameters:
      M -
      Parameters:
      map -
      propOrMsg -
      Returns:
    • notEmpty

      public static <C extends Collection<?>> C notEmpty(C col, String propOrMsg)
      Assert that the given Collection is not empty
      Type Parameters:
      C -
      Parameters:
      col -
      propOrMsg -
      Returns:
    • isTrue

      public static boolean isTrue(boolean condition, String propOrMsg)
      Assert that the given condition is true
      Parameters:
      condition -
      propOrMsg -
      Returns:
    • isFalse

      public static boolean isFalse(boolean condition, String propOrMsg)
      Assert that the given condition is true
      Parameters:
      condition -
      propOrMsg -
      Returns:
    • assertThat

      public static <T> T assertThat(boolean condition, String propOrMsg, String msgSuffix, T rv)
      General assertion mwthos
      Type Parameters:
      T -
      Parameters:
      condition -
      propOrMsg -
      msgSuffix -
      rv -
      Returns: