Class NullCheckingUtil

java.lang.Object
org.bonitasoft.engine.commons.NullCheckingUtil

public class NullCheckingUtil extends Object
Author:
Elias Ricken de Medeiros
  • Constructor Details

    • NullCheckingUtil

      public NullCheckingUtil()
  • Method Details

    • checkArgsNotNull

      public static void checkArgsNotNull(Object... params)
      Check that the given parameters are not null. This method should only be used to check that some parameters given to a given method are not null. The exception message tries its best to produce a helpful message by scanning the stack trace.
      Parameters:
      params - the parameters to check
      Throws:
      IllegalArgumentException - if at least one of the parameters is null
    • findNull

      public static NullCheckingUtil.NullCheckResult findNull(Object... params)
      Find null parameters in the given list. This method returns a NullCheckingUtil.NullCheckResult.
      Parameters:
      params - the parameters to check
      Returns:
      a NullCheckingUtil.NullCheckResult representing null parameters.
      See Also:
    • getCaller

      public static StackTraceElement getCaller(int offset)
      Return the StackTraceElement at the given offset from this method invocation.
      Parameters:
      offset -
      Returns:
      a StackTraceElement
    • badStateIfNull

      public static void badStateIfNull(Object valueToCheck, String msg)
      This method throw an IllegalStateException if the given parameter is null
      Parameters:
      valueToCheck - the value to check
      msg - the message for the thrown exception
      See Also:
    • badStateIfTrue

      public static void badStateIfTrue(boolean valueToCheck, String msg)
      This method throw an IllegalStateException if the given parameter is true
      Parameters:
      valueToCheck - the value to check
      msg - the message for the thrown exception
      See Also: