Class Assert


  • final class Assert
    extends java.lang.Object
    Assertion utility methods.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Assert()
      Private CTOR.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void isTrue​(boolean expression, java.lang.String message)
      Check if the specified expression is true.
      static void notNull​(java.lang.Object object, java.lang.String message)
      Check if the specified object is null, and throw an IllegalArgumentException if it is.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Assert

        private Assert()
        Private CTOR.
    • Method Detail

      • isTrue

        public static void isTrue​(boolean expression,
                                  java.lang.String message)
        Check if the specified expression is true. If not throw an IllegalArgumentException with the specified message.
        Parameters:
        expression - The expression to check.
        message - The exception message if the expression is false.
      • notNull

        public static void notNull​(java.lang.Object object,
                                   java.lang.String message)
        Check if the specified object is null, and throw an IllegalArgumentException if it is.
        Parameters:
        object - The object to check.
        message - The exception message if the object is null.