de.smartics.util.lang
Class Arguments

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

Deprecated.  Due to a breaking change a new class called Arg has been designed to be used from now on. It has the same methods as this one, but it returns the value passed in to check. This allows to do the check and an initialization (e.g. in a constructor) in one line. It also allows to check arguments if another constructor is called (such as in this() and super()). This class is planned to be removed with the release of version 2.0.

@Deprecated
public final class Arguments
     
     
extends Object

Utility class to check arguments.


Method Summary
static void checkNotBlank(String name, String value)
          Deprecated. Checks if value is blank.
static void checkNotBlank(String name, String value, String message)
          Deprecated. Checks if value is blank providing an additional message.
static void checkNotBlankExceptNull(String name, String value)
          Deprecated. Checks if value is blank except null.
static void checkNotBlankExceptNull(String name, String value, String message)
          Deprecated. Checks if value is blank except null providing an additional message.
static void checkNotNull(String name, Object value)
          Deprecated. Checks if value is null.
static void checkNotNull(String name, Object value, String message)
          Deprecated. 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
Deprecated. 
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
Deprecated. 
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
Deprecated. 
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
Deprecated. 
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
Deprecated. 
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
Deprecated. 
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-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.