Package org.owasp.esapi.util
Class NullSafe
- java.lang.Object
-
- org.owasp.esapi.util.NullSafe
-
public class NullSafe extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
equals(java.lang.Object a, java.lang.Object b)
Object.equals(Object)
that safely handles nulls.static int
hashCode(java.lang.Object o)
Object.hashCode()
of an object.static java.lang.String
toString(java.lang.Object o)
Object.toString()
of an object.
-
-
-
Method Detail
-
equals
public static boolean equals(java.lang.Object a, java.lang.Object b)
Object.equals(Object)
that safely handles nulls.- Parameters:
a
- First objectb
- Second object- Returns:
- true if a == b or a.equals(b). false otherwise.
-
hashCode
public static int hashCode(java.lang.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 java.lang.String toString(java.lang.Object o)
Object.toString()
of an object.- Parameters:
o
- Object to get a String for.- Returns:
- "(null)" o is null. Otherwise o.toString().
-
-