Class 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 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 holders
        objectArgs - 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 holders
        cause - original exception cause
        objectArgs - arguments to be added to formatted string message
      • PlanItException

        public PlanItException​(Exception parentException)
        Constructor using Exception - wraps run-time exceptions
        Parameters:
        parentException - source exception
      • PlanItException

        public PlanItException​(String exceptionDescription,
                               Throwable cause)
        Constructor using Throwable - wraps run-time exceptions with additional message
        Parameters:
        exceptionDescription - message
        cause - original exception cause
    • Method Detail

      • throwIf

        public static void throwIf​(boolean condition,
                                   String message,
                                   Object... objectArgs)
                            throws PlanItException
        Throw a planitException if condition is met
        Parameters:
        condition - when met we throw
        message - for exception
        objectArgs - 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 test
        message - 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 test
        message - for exception
        objectArgs - to format exception string with
        Throws:
        PlanItException - thrown when condition not met