de.smartics.util.lang
Class Arguments

Package class diagram package Arguments
java.lang.Object
  extended by de.smartics.util.lang.Arguments

public final class Arguments
     
     
extends Object

Utility class to check arguments.


Method Summary
static void checkNotBlank(String name, String value)
          Checks if value is blank.
static void checkNotBlank(String name, String value, String message)
          Checks if value is blank providing an additional message.
static void checkNotBlankExceptNull(String name, String value)
          Checks if value is blank except null.
static void checkNotBlankExceptNull(String name, String value, String message)
          Checks if value is blank except null providing an additional message.
static void checkNotNull(String name, Object value)
          Checks if value is null.
static void checkNotNull(String name, Object value, String message)
          Checks if value is null providing an additional message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkNotNull

public static void checkNotNull(String name,
                                Object value)
                         throws NullPointerException
Checks if value is null.

Parameters:
name - the name of the argument of error reporting. Not used if no exception is thrown. May be null, although not recommended.
value - the value of the argument to check to be not null .
Throws:
NullPointerException - if value is null.

checkNotNull

public static void checkNotNull(String name,
                                Object value,
                                String message)
                         throws NullPointerException
Checks if value is null providing an additional message.

Parameters:
name - the name of the argument of error reporting. Not used if no exception is thrown. May be null, although not recommended.
value - the value of the argument to check to be not null .
message - the message to pass to the exception as additional information to the standard message being generated.
Throws:
NullPointerException - if value is null.

checkNotBlank

public static void checkNotBlank(String name,
                                 String value)
                          throws BlankArgumentException
Checks if value is blank.

Parameters:
name - the name of the argument of error reporting. Not used if no exception is thrown. May be null, although not recommended.
value - the value of the argument to check to be not blank.
Throws:
BlankArgumentException - if value is blank.

checkNotBlank

public static void checkNotBlank(String name,
                                 String value,
                                 String message)
                          throws BlankArgumentException
Checks if value is blank providing an additional message.

Parameters:
name - the name of the argument of error reporting. Not used if no exception is thrown. May be null, although not recommended.
value - the value of the argument to check to be not blank.
message - the message to pass to the exception as additional information to the standard message being generated.
Throws:
BlankArgumentException - if value is blank.

checkNotBlankExceptNull

public static void checkNotBlankExceptNull(String name,
                                           String value)
                                    throws BlankExceptNullArgumentException
Checks if value is blank except null.

Parameters:
name - the name of the argument of error reporting. Not used if no exception is thrown. May be null, although not recommended.
value - the value of the argument to check to be not blank but may be null.
Throws:
BlankExceptNullArgumentException - if value is blank and not null.

checkNotBlankExceptNull

public static void checkNotBlankExceptNull(String name,
                                           String value,
                                           String message)
                                    throws BlankExceptNullArgumentException
Checks if value is blank except null providing an additional message.

Parameters:
name - the name of the argument of error reporting. Not used if no exception is thrown. May be null, although not recommended.
value - the value of the argument to check to be not blank but may be null.
message - the message to pass to the exception as additional information to the standard message being generated.
Throws:
BlankExceptNullArgumentException - if value is blank and not null.


Copyright © 2011-2012 Kronseder & Reiner GmbH - smartics. All Rights Reserved.