Package org.goplanit.utils.exceptions
Class PlanItException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.goplanit.utils.exceptions.PlanItException
-
- All Implemented Interfaces:
Serializable
public class PlanItException extends Exception
General exception for PlanIt which wraps exceptions thrown during execution- Author:
- markr
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PlanItException(Exception parentException)Constructor using Exception - wraps run-time exceptionsPlanItException(String exceptionDescription)Constructor using String - catches logic-driven exceptionsPlanItException(String exceptionDescription, Object... objectArgs)Constructor using formatted string - catches logic-driven exceptionsPlanItException(String exceptionDescription, Throwable cause)Constructor using Throwable - wraps run-time exceptions with additional messagePlanItException(String exceptionDescription, Throwable cause, Object... objectArgs)Constructor using formatted string - catches logic-driven exceptions
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidthrowIf(boolean condition, String message, Object... objectArgs)Throw a planitException if condition is metstatic voidthrowIfNull(Object object, String message)Throw a planitException if object is nullstatic voidthrowIfNull(Object object, String message, Object... objectArgs)Throw a planitException if object is null-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
PlanItException
public PlanItException(String exceptionDescription)
Constructor using String - catches logic-driven exceptions- Parameters:
exceptionDescription- text containing description of logic error
-
PlanItException
public PlanItException(String exceptionDescription, Object... objectArgs)
Constructor using formatted string - catches logic-driven exceptions- Parameters:
exceptionDescription- text containing description of logic error with formatted place holdersobjectArgs- arguments to be added to formatted string message
-
PlanItException
public PlanItException(String exceptionDescription, Throwable cause, Object... objectArgs)
Constructor using formatted string - catches logic-driven exceptions- Parameters:
exceptionDescription- text containing description of logic error with formatted place holderscause- original exception causeobjectArgs- arguments to be added to formatted string message
-
PlanItException
public PlanItException(Exception parentException)
Constructor using Exception - wraps run-time exceptions- Parameters:
parentException- source exception
-
-
Method Detail
-
throwIf
public static void throwIf(boolean condition, String message, Object... objectArgs) throws PlanItExceptionThrow a planitException if condition is met- Parameters:
condition- when met we throwmessage- for exceptionobjectArgs- to format exception string with- Throws:
PlanItException- thrown when condition not met
-
throwIfNull
public static void throwIfNull(Object object, String message) throws PlanItException
Throw a planitException if object is null- Parameters:
object- to testmessage- for exception- Throws:
PlanItException- thrown when condition not met
-
throwIfNull
public static void throwIfNull(Object object, String message, Object... objectArgs) throws PlanItException
Throw a planitException if object is null- Parameters:
object- to testmessage- for exceptionobjectArgs- to format exception string with- Throws:
PlanItException- thrown when condition not met
-
-