Class BmAssert


  • public final class BmAssert
    extends Object
    Util class helpfull for validating arguments.
    • Method Detail

      • isLegal

        public static boolean isLegal​(boolean expression)
        Throws IllegalArgumentException if given expression is false.
        Parameters:
        expression - - expression to check.
        Returns:
        given expression.
      • isLegal

        public static boolean isLegal​(boolean expression,
                                      String message)
        Throws IllegalArgumentException with given message if given expression is false.
        Parameters:
        expression - - expression to check.
        message - - message to add to exception.
        Returns:
        given expression.
      • isNotNull

        public static void isNotNull​(Object object)
        Throws BmAssertionException if given object is null.
        Parameters:
        object - - object to check.
      • isNotNull

        public static void isNotNull​(Object object,
                                     String message)
        Throws BmAssertionException with given message if given object is null.
        Parameters:
        object - - object to check.
        message - - message to add to exception.
      • isTrue

        public static void isTrue​(boolean expression)
        Throws BmAssertionException if given expression is false.
        Parameters:
        expression - - expression to check.
      • isTrue

        public static void isTrue​(boolean expression,
                                  String message)
        Throws BmAssertionException with given message if given expression is false.
        Parameters:
        expression - - expression to check.
        message - - message to add to exception.