Class Assert

java.lang.Object
org.castor.core.util.Assert

public class Assert extends Object
A helper class that defines a method used for validating the input arguments.
Since:
1.3.3
Version:
1.3.3
Author:
Jakub Narloch
  • Method Details

    • paramNotNull

      public static void paramNotNull(Object param, String paramName)
      Asserts that passed parameter is not null. In case it is, then an IllegalArgumentException is thrown.
      Parameters:
      param - the parameter to check
      paramName - the parameter name
      Throws:
      IllegalArgumentException - if param is null
    • paramNotEmpty

      public static void paramNotEmpty(String param, String paramName)
      Asserts that passed parameter is not null and not empty. In case it is, then an IllegalArgumentException is thrown.
      Parameters:
      param - the parameter to check
      paramName - the parameter name
      Throws:
      IllegalArgumentException - if param is null or empty string
    • notNull

      public static void notNull(Object obj, String msg)
      Asserts that passed object instance is not null. In case it is, then an IllegalArgumentException is thrown.
      Parameters:
      obj - the object instance to check
      msg - the error message to use
      Throws:
      IllegalArgumentException - if obj is null
    • notEmpty

      public static void notEmpty(String obj, String msg)
      Asserts that passed object instance is not null and not empty. In case it is, then an IllegalArgumentException is thrown.
      Parameters:
      obj - the object instance to check
      msg - the error message to use
      Throws:
      IllegalArgumentException - if obj is null or empty string