patterntesting.runtime
Class NullConstants

Package class diagram package NullConstants
java.lang.Object
  extended by patterntesting.runtime.NullConstants

public final class NullConstants
extends Object

This class contains some constants (like a NULL_STRING) as constant. It can be statically imported.

Since:
13.06.2009
Version:
$Revision: 1.2 $
Author:
oliver

Field Summary
static Date NULL_DATE
          You need a null date and don't want to use null?
static Throwable NULL_EXCEPTION
          You need a null exception and don't want to use null?
static File NULL_FILE
          You need a null file and don't want to use null?
static Object NULL_OBJECT
          If you have a method with a list of arguments where some arguments are optional you can provide the method with different signatures (good idea, but not always feasible) admit null arguments and handle it in the methode (not a good idea because it can happen accidentally) use this special NULL_OBJECT object to mark an argument as optional Unfortunately this works only for object as argument.
static String NULL_STRING
          You need a null string and don't want to use null?
static Throwable NULL_THROWABLE
          You need a null throwable and don't want to use null?
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_OBJECT

public static final Object NULL_OBJECT
If you have a method with a list of arguments where some arguments are optional you can Unfortunately this works only for object as argument. For String as argument you can use NULL_STRING.

See Also:
NULL_STRING

NULL_STRING

public static final String NULL_STRING
You need a null string and don't want to use null? Use NULL_STRING and you can write code like
 if (name == NULL_STRING) ...
 

See Also:
Constant Field Values

NULL_FILE

public static final File NULL_FILE
You need a null file and don't want to use null? Use NULL_FILE and you can write code like
 if (name == NULL_STRING) ...
 


NULL_THROWABLE

public static final Throwable NULL_THROWABLE
You need a null throwable and don't want to use null? Use NULL_THROWABLE and you can write code like
 if (name == NULL_THROWABLE) ...
 


NULL_EXCEPTION

public static final Throwable NULL_EXCEPTION
You need a null exception and don't want to use null? Use NULL_EXCEPTION and you can write code like
 if (name == NULL_EXCEPTION) ...
 


NULL_DATE

public static final Date NULL_DATE
You need a null date and don't want to use null? Use NULL_DATE and you can write code like
 if (name == NULL_DATE) ...
 
The NULL_DATE is defined here as 1.1.1970 (the epoch).



Copyright © 2002–2014 PatternTesting Team. All rights reserved.