Class ExceptionUtils

java.lang.Object
org.assertj.guava.util.ExceptionUtils

public class ExceptionUtils extends Object
  • Constructor Details

    • ExceptionUtils

      protected ExceptionUtils()
      protected to avoid direct instanciation but allowing subclassing.
  • Method Details

    • throwIllegalArgumentExceptionIfTrue

      public static void throwIllegalArgumentExceptionIfTrue(boolean condition, String exceptionMessage, Object... exceptionMessageArgs)
      Throws a IllegalArgumentException if given condition is true with message formatted with given arguments using String.format(String, Object...).
      Parameters:
      condition - condition that will trigger the IllegalArgumentException if true
      exceptionMessage - message set in thrown IllegalArgumentException
      exceptionMessageArgs - arguments to be used to format exceptionMessage
      Throws:
      IllegalArgumentException - if condition is true