Class Objects


  • public final class Objects
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int hashCode​(boolean bool)
      Return the same value as Boolean.hashCode().
      static int hashCode​(double dbl)
      Return the same value as Double.hashCode().
      static int hashCode​(float flt)
      Return the same value as Float.hashCode().
      static int hashCode​(long lng)
      Return the same value as Long.hashCode().
      static int nullSafeHashCode​(boolean[] array)
      Return a hash code based on the contents of the specified array.
      static int nullSafeHashCode​(byte[] array)
      Return a hash code based on the contents of the specified array.
      static int nullSafeHashCode​(char[] array)
      Return a hash code based on the contents of the specified array.
      static int nullSafeHashCode​(double[] array)
      Return a hash code based on the contents of the specified array.
      static int nullSafeHashCode​(float[] array)
      Return a hash code based on the contents of the specified array.
      static int nullSafeHashCode​(int[] array)
      Return a hash code based on the contents of the specified array.
      static int nullSafeHashCode​(long[] array)
      Return a hash code based on the contents of the specified array.
      static int nullSafeHashCode​(short[] array)
      Return a hash code based on the contents of the specified array.
      static int nullSafeHashCode​(java.lang.Object obj)
      Return as hash code for the given object; typically the value of Object.hashCode().
      static int nullSafeHashCode​(java.lang.Object[] array)
      Return a hash code based on the contents of the specified array.
      static java.lang.String nullSafeToString​(boolean[] array)
      Return a String representation of the contents of the specified array.
      static java.lang.String nullSafeToString​(byte[] array)
      Return a String representation of the contents of the specified array.
      static java.lang.String nullSafeToString​(char[] array)
      Return a String representation of the contents of the specified array.
      static java.lang.String nullSafeToString​(double[] array)
      Return a String representation of the contents of the specified array.
      static java.lang.String nullSafeToString​(float[] array)
      Return a String representation of the contents of the specified array.
      static java.lang.String nullSafeToString​(int[] array)
      Return a String representation of the contents of the specified array.
      static java.lang.String nullSafeToString​(long[] array)
      Return a String representation of the contents of the specified array.
      static java.lang.String nullSafeToString​(short[] array)
      Return a String representation of the contents of the specified array.
      static java.lang.String nullSafeToString​(java.lang.Object obj)
      Return a String representation of the specified Object.
      static java.lang.String nullSafeToString​(java.lang.Object[] array)
      Return a String representation of the contents of the specified array.
      • Methods inherited from class java.lang.Object

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

      • nullSafeHashCode

        public static int nullSafeHashCode​(java.lang.Object[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • nullSafeHashCode

        public static int nullSafeHashCode​(boolean[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • nullSafeHashCode

        public static int nullSafeHashCode​(byte[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • nullSafeHashCode

        public static int nullSafeHashCode​(char[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • nullSafeHashCode

        public static int nullSafeHashCode​(double[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • nullSafeHashCode

        public static int nullSafeHashCode​(float[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • nullSafeHashCode

        public static int nullSafeHashCode​(int[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • nullSafeHashCode

        public static int nullSafeHashCode​(long[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • nullSafeHashCode

        public static int nullSafeHashCode​(short[] array)
        Return a hash code based on the contents of the specified array. If array is null, this method returns 0.
      • hashCode

        public static int hashCode​(boolean bool)
        Return the same value as Boolean.hashCode().
        See Also:
        Boolean.hashCode()
      • hashCode

        public static int hashCode​(double dbl)
        Return the same value as Double.hashCode().
        See Also:
        Double.hashCode()
      • hashCode

        public static int hashCode​(float flt)
        Return the same value as Float.hashCode().
        See Also:
        Float.hashCode()
      • hashCode

        public static int hashCode​(long lng)
        Return the same value as Long.hashCode().
        See Also:
        Long.hashCode()
      • nullSafeToString

        public static java.lang.String nullSafeToString​(java.lang.Object obj)
        Return a String representation of the specified Object.

        Builds a String representation of the contents in case of an array. Returns "null" if obj is null.

        Parameters:
        obj - the object to build a String representation for
        Returns:
        a String representation of obj
      • nullSafeToString

        public static java.lang.String nullSafeToString​(java.lang.Object[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array
      • nullSafeToString

        public static java.lang.String nullSafeToString​(boolean[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array
      • nullSafeToString

        public static java.lang.String nullSafeToString​(byte[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array
      • nullSafeToString

        public static java.lang.String nullSafeToString​(char[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array
      • nullSafeToString

        public static java.lang.String nullSafeToString​(double[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array
      • nullSafeToString

        public static java.lang.String nullSafeToString​(float[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array
      • nullSafeToString

        public static java.lang.String nullSafeToString​(int[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array
      • nullSafeToString

        public static java.lang.String nullSafeToString​(long[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array
      • nullSafeToString

        public static java.lang.String nullSafeToString​(short[] array)
        Return a String representation of the contents of the specified array.

        The String representation consists of a list of the array's elements, enclosed in curly braces ("{}"). Adjacent elements are separated by the characters ", " (a comma followed by a space). Returns "null" if array is null.

        Parameters:
        array - the array to build a String representation for
        Returns:
        a String representation of array