com.babaroga.test
Class Args

java.lang.Object
  extended by com.babaroga.test.Args

public final class Args
extends java.lang.Object

Provides a clean, uniform way to check argument validity.


Method Summary
static void checkNonNull(java.lang.Object object)
          Throws an IllegalArgumentException if the specified object is not null.
static void checkNonNull(java.lang.Object object, java.lang.String message)
          Throws an IllegalArgumentException if the specified object is not null.
static void checkNotEmpty(java.lang.String s)
          Throws an IllegalArgumentException if the specified string is empty.
static void checkNotEmpty(java.lang.String s, java.lang.String message)
          Throws an IllegalArgumentException if the specified string is empty.
static void checkPositive(int integer)
          Throws an IllegalArgumentException if the specified integer is not positive.
static void checkPositive(int integer, java.lang.String message)
          Throws an IllegalArgumentException if the specified integer is not positive.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkNonNull

public static void checkNonNull(java.lang.Object object)
Throws an IllegalArgumentException if the specified object is not null.

Parameters:
object - The object to check for null.

checkNonNull

public static void checkNonNull(java.lang.Object object,
                                java.lang.String message)
Throws an IllegalArgumentException if the specified object is not null.

Parameters:
object - The object to check for null.
message - A message to pass to the exception.

checkPositive

public static void checkPositive(int integer)
Throws an IllegalArgumentException if the specified integer is not positive.

Parameters:
integer - The integer to check if positive.

checkPositive

public static void checkPositive(int integer,
                                 java.lang.String message)
Throws an IllegalArgumentException if the specified integer is not positive.

Parameters:
integer - The integer to check if positive.
message - A message to pass to the exception.

checkNotEmpty

public static void checkNotEmpty(java.lang.String s)
Throws an IllegalArgumentException if the specified string is empty.

Parameters:
s - The string to check if empty.

checkNotEmpty

public static void checkNotEmpty(java.lang.String s,
                                 java.lang.String message)
Throws an IllegalArgumentException if the specified string is empty.

Parameters:
s - The string to check if empty.
message - A message to pass to the exception.