com.tomgibara.pronto.util
Class Arguments

java.lang.Object
  extended by com.tomgibara.pronto.util.Arguments

public final class Arguments
extends java.lang.Object

Holds static methods for performing common checks on method parameters.

Author:
Tom Gibara

Method Summary
static void notEmpty(java.lang.String str, java.lang.String name)
          Tests whether the supplied string parameter is not null and not the empty string.
static void notNegative(long num, java.lang.String name)
          Tests whether the supplied long parameter is not negative.
static void notNull(java.lang.Object obj, java.lang.String name)
          Tests whether the supplied parameter is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

notNull

public static void notNull(java.lang.Object obj,
                           java.lang.String name)
                    throws java.lang.IllegalArgumentException
Tests whether the supplied parameter is null.

Parameters:
obj - the parameter
name - the name of the parameter
Throws:
java.lang.IllegalArgumentException - if the parameter is null

notEmpty

public static void notEmpty(java.lang.String str,
                            java.lang.String name)
                     throws java.lang.IllegalArgumentException
Tests whether the supplied string parameter is not null and not the empty string.

Parameters:
str - the string parameter
name - the name of the parameter
Throws:
java.lang.IllegalArgumentException - if the parameter is null or has zero length

notNegative

public static void notNegative(long num,
                               java.lang.String name)
                        throws java.lang.IllegalArgumentException
Tests whether the supplied long parameter is not negative.

Parameters:
num - the long parameter
name - the name of the parameter
Throws:
java.lang.IllegalArgumentException - if the parameter is less than zero


Copyright © 2006-2007 Tom Gibara. All Rights Reserved.