Class CheckUtils


  • public class CheckUtils
    extends Object
    Common utilities for precondition checking.
    • Constructor Detail

      • CheckUtils

        public CheckUtils()
    • Method Detail

      • paramNotNull

        public static void paramNotNull​(Object parameter,
                                        String parameterName)
                                 throws MalformedArgumentsException
        Ensures that an object reference passed as a parameter to the calling method is not null.
        Parameters:
        parameter - param to check
        parameterName - name of the parameter
        Throws:
        MalformedArgumentsException - if parameter is null
      • paramNotEmpty

        public static void paramNotEmpty​(String parameter,
                                         String parameterName)
                                  throws MalformedArgumentsException
        Ensures that a string passed as a parameter to the calling method is not null or empty.
        Parameters:
        parameter - param to check
        parameterName - name of the parameter
        Throws:
        MalformedArgumentsException - if parameter is null or empty