Class ObjectUtil


  • public class ObjectUtil
    extends java.lang.Object
    Generic utility methods related to objects.
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static boolean nullEquals​(java.lang.Object o1, java.lang.Object o2)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static int nullHashCode​(java.lang.Object o)
      Returns the hash code of the supplied object, or 0 if a null reference is supplied.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectUtil

        public ObjectUtil()
    • Method Detail

      • nullEquals

        @Deprecated(since="4.0.0",
                    forRemoval=true)
        public static boolean nullEquals​(java.lang.Object o1,
                                         java.lang.Object o2)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Compares two objects or null references.
        Parameters:
        o1 - The first object.
        o2 - The second object
        Returns:
        true if both objects are null, if the object references are identical, or if the objects are equal according to the Object.equals(java.lang.Object) method of the first object; false in all other situations.
      • nullHashCode

        public static int nullHashCode​(java.lang.Object o)
        Returns the hash code of the supplied object, or 0 if a null reference is supplied.
        Parameters:
        o - An object or null reference.
        Returns:
        The object's hash code, or 0 if the parameter is null.