ch.panter.li.bi.util
Class ArgumentTool

java.lang.Object
  extended by ch.panter.li.bi.util.ArgumentTool

public final class ArgumentTool
extends Object


Method Summary
static boolean isNullOrEmpty(String arg)
          Determines whether the given argument is null or the empty string.
static boolean isNullOrEmptyWhenTrimmed(String arg)
          Determines whether the given argument is null or the empty string when it is trimmed of whitespace.
static String nonEmptyArgument(String arg)
          Returns the given string after checking it is not null and not empty.
static String nonEmptyTrimmedArgument(String arg)
          Returns the given string after checking it is not null and not empty after trimming it.
static
<T> T
nonNullArgument(T arg)
          Returns the given argument after checking it is not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

nonNullArgument

public static <T> T nonNullArgument(T arg)
Returns the given argument after checking it is not null.

Parameters:
arg - the argument to check
Returns:
the given argument
Throws:
IllegalArgumentException - in case the given argument is null

nonEmptyArgument

public static String nonEmptyArgument(String arg)
Returns the given string after checking it is not null and not empty.

Parameters:
arg - the argument to check
Returns:
the given argument
Throws:
IllegalArgumentException - in case the given argument is null or of zero length

nonEmptyTrimmedArgument

public static String nonEmptyTrimmedArgument(String arg)
Returns the given string after checking it is not null and not empty after trimming it.

Parameters:
arg - the argument to check
Returns:
the given argument
Throws:
IllegalArgumentException - in case the given argument is null or of zero length after trimming it

isNullOrEmpty

public static boolean isNullOrEmpty(String arg)
Determines whether the given argument is null or the empty string.

Parameters:
arg - the argument to check
Returns:
true if the given argument is null of of zero length

isNullOrEmptyWhenTrimmed

public static boolean isNullOrEmptyWhenTrimmed(String arg)
Determines whether the given argument is null or the empty string when it is trimmed of whitespace.

Parameters:
arg - the argument to check
Returns:
true if the given argument is null of of zero length after trimming whitespace


Copyright 2007-2007 SourceForge. All Rights Reserved.