Class 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.
      • 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​(java.lang.Object a,
                                     java.lang.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​(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().