org.jboss.cache.aop.util
Class Null

java.lang.Object
  extended by org.jboss.cache.aop.util.Null
All Implemented Interfaces:
java.io.Serializable

public final class Null
extends java.lang.Object
implements java.io.Serializable

Represent null values (based on org.jboss.util.Null)

Author:
Scott Marlow
See Also:
Serialized Form

Method Summary
 boolean equals(java.lang.Object obj)
          Check if the given object is a Null instance or null.
 int hashCode()
          Hashcode of unknown (null) value will be zero.
static java.lang.Object toNullKeyObject(java.lang.Object aObject)
          Represents null key as a special string value.
static java.lang.Object toNullKeyValue(java.lang.Object aObject)
          Converts Null string representation back to null value.
static java.lang.Object toNullObject(java.lang.Object aObject)
          Represents null as a special Null object marker.
static java.lang.Object toNullValue(java.lang.Object aObject)
          If the passed object represents null (instance of Null.NULL_OBJECT_MARKER), will replace with null value.
 java.lang.String toString()
          Return a string representation of null value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

toNullObject

public static final java.lang.Object toNullObject(java.lang.Object aObject)
Represents null as a special Null object marker.

Parameters:
aObject -
Returns:
if aObject is null, return Null.NULL_OBJECT_MARKER otherwise return aObject.

toNullKeyObject

public static final java.lang.Object toNullKeyObject(java.lang.Object aObject)
Represents null key as a special string value.

Parameters:
aObject -
Returns:
if aObject is null, return Null.NULL_AS_STRING_REPRESENTATION otherwise return aObject.

toNullValue

public static final java.lang.Object toNullValue(java.lang.Object aObject)
If the passed object represents null (instance of Null.NULL_OBJECT_MARKER), will replace with null value.

Parameters:
aObject -
Returns:
null if aObject is instance of Null.NULL_OBJECT_MARKER, otherwise return aObject.

toNullKeyValue

public static final java.lang.Object toNullKeyValue(java.lang.Object aObject)
Converts Null string representation back to null value.

Parameters:
aObject -
Returns:
null if aObject represents a null, otherwise return aObject.

toString

public java.lang.String toString()
Return a string representation of null value.

Overrides:
toString in class java.lang.Object
Returns:
Null.NULL_AS_STRING_REPRESENTATION;

hashCode

public int hashCode()
Hashcode of unknown (null) value will be zero.

Overrides:
hashCode in class java.lang.Object
Returns:
Zero.

equals

public boolean equals(java.lang.Object obj)
Check if the given object is a Null instance or null.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object to test.
Returns:
True if the given object is a Null instance or null.


Copyright 1998-2005 JBoss Inc . All Rights Reserved.