org.xins.common
Class MandatoryArgumentChecker

java.lang.Object
  extended byorg.xins.common.MandatoryArgumentChecker

public final class MandatoryArgumentChecker
extends Object

Utility class used to check mandatory method arguments.

Since:
XINS 1.0.0
Version:
$Revision: 1.15 $ $Date: 2006/08/28 09:12:35 $
Author:
Ernst de Haan

Method Summary
static void check(String argName, Object argValue)
          Checks if the specified argument value is null.
static void check(String argName1, Object argValue1, String argName2, Object argValue2)
          Checks if any of the two specified argument values is null.
static void check(String argName1, Object argValue1, String argName2, Object argValue2, String argName3, Object argValue3)
          Checks if any of the three specified argument values is null.
static void check(String argName1, Object argValue1, String argName2, Object argValue2, String argName3, Object argValue3, String argName4, Object argValue4)
          Checks if any of the four specified argument values is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

check

public static void check(String argName,
                         Object argValue)
                  throws IllegalArgumentException
Checks if the specified argument value is null. If it is null, then an IllegalArgumentException is thrown.

Parameters:
argName - the name of the argument, cannot be null.
argValue - the value of the argument.
Throws:
IllegalArgumentException - if argValue == null.

check

public static void check(String argName1,
                         Object argValue1,
                         String argName2,
                         Object argValue2)
                  throws IllegalArgumentException
Checks if any of the two specified argument values is null. If at least one value is null, then an IllegalArgumentException is thrown.

Parameters:
argName1 - the name of the first argument, cannot be null.
argValue1 - the value of the first argument.
argName2 - the name of the second argument, cannot be null.
argValue2 - the value of the second argument.
Throws:
IllegalArgumentException - if argValue1 == null || argValue2 == null.

check

public static void check(String argName1,
                         Object argValue1,
                         String argName2,
                         Object argValue2,
                         String argName3,
                         Object argValue3)
                  throws IllegalArgumentException
Checks if any of the three specified argument values is null. If at least one value is null, then an IllegalArgumentException is thrown.

Parameters:
argName1 - the name of the first argument, cannot be null.
argValue1 - the value of the first argument.
argName2 - the name of the second argument, cannot be null.
argValue2 - the value of the second argument.
argName3 - the name of the third argument, cannot be null.
argValue3 - the value of the third argument.
Throws:
IllegalArgumentException - if argValue1 == null || argValue2 == null || argValue3 == null.

check

public static void check(String argName1,
                         Object argValue1,
                         String argName2,
                         Object argValue2,
                         String argName3,
                         Object argValue3,
                         String argName4,
                         Object argValue4)
                  throws IllegalArgumentException
Checks if any of the four specified argument values is null. If at least one value is null, then an IllegalArgumentException is thrown.

Parameters:
argName1 - the name of the first argument, cannot be null.
argValue1 - the value of the first argument.
argName2 - the name of the second argument, cannot be null.
argValue2 - the value of the second argument.
argName3 - the name of the third argument, cannot be null.
argValue3 - the value of the third argument.
argName4 - the name of the fourth argument, cannot be null.
argValue4 - the value of the fourth argument.
Throws:
IllegalArgumentException - if argValue1 == null || argValue2 == null || argValue3 == null || argValue4 == null.


See http://www.xins.org/.