org.owasp.esapi.util
Class NullSafe

java.lang.Object
  extended by org.owasp.esapi.util.NullSafe

public class NullSafe
extends Object


Method Summary
static boolean equals(Object a, Object b)
          Object.equals(Object) that safely handles nulls.
static int hashCode(Object o)
          Object.hashCode() of an object.
static String toString(Object o)
          Object.toString() of an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static boolean equals(Object a,
                             Object b)
Object.equals(Object) that safely handles nulls.

Parameters:
a - First object
b - Second object
Returns:
true if a == b or a.equals(b). false otherwise.

hashCode

public static int hashCode(Object o)
Object.hashCode() of an object.

Parameters:
o - Object to get a hashCode for.
Returns:
0 if o is null. Otherwise o.hashCode().

toString

public static String toString(Object o)
Object.toString() of an object.

Parameters:
o - Object to get a String for.
Returns:
"(null)" o is null. Otherwise o.toString().


Copyright © 2011 The Open Web Application Security Project (OWASP). All Rights Reserved.