Class ExceptionUtils


  • public class ExceptionUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ExceptionUtils()
      protected to avoid direct instanciation but allowing subclassing.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void throwIllegalArgumentExceptionIfTrue​(boolean condition, java.lang.String exceptionMessage, java.lang.Object... exceptionMessageArgs)
      Throws a IllegalArgumentException if given condition is true with message formatted with given arguments using String.format(String, Object...).
      • Methods inherited from class java.lang.Object

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

      • ExceptionUtils

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

      • throwIllegalArgumentExceptionIfTrue

        public static void throwIllegalArgumentExceptionIfTrue​(boolean condition,
                                                               java.lang.String exceptionMessage,
                                                               java.lang.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:
        java.lang.IllegalArgumentException - if condition is true