Class Assert

java.lang.Object
com.pnfsoftware.jeb.util.base.Assert

public abstract class Assert extends Object
A replacement for built-in asserts. Production-compatible assert-likes. Do not throw AssertionError on failure; instead, a RuntimeException is raised.

Assert methods throw RuntimeException. The stacktrace of such as exception is adjusted to reflect the actual code line where a(...) or fail(...) was called.

  • Constructor Details

    • Assert

      public Assert()
  • Method Details

    • a

      public static void a(boolean expression, String message)
      Assert that condition is true
    • a

      public static void a(boolean expression, String message, Object... args)
    • a

      public static void a(boolean expression)
    • fail

      public static void fail(String message)
    • fail

      public static void fail()
    • debugFail

      public static void debugFail(String message)
      Fail ONLY on debug builds. Use carefully; this method can yield side-effect bugs on release builds that would have otherwise be caught in debug mode.
      Parameters:
      message -
    • debugFail

      public static void debugFail()
      Fail ONLY on debug builds. Use carefully; this method can yield side-effect bugs on release builds that would have otherwise be caught in debug mode.
    • debugFail

      public static void debugFail(Throwable t)