Package com.aspectran.core.util
Class ObjectUtils
- java.lang.Object
-
- com.aspectran.core.util.ObjectUtils
-
public abstract class ObjectUtils extends java.lang.Object
(This class is a member of the Spring Framework.)
Miscellaneous object utility methods.
-
-
Constructor Summary
Constructors Constructor Description ObjectUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
nullSafeEquals(java.lang.Object o1, java.lang.Object o2)
Determine if the given objects are equal, returningtrue
if both arenull
orfalse
if only one isnull
.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 ofObject#hashCode()
}.static int
nullSafeHashCode(java.lang.Object[] array)
Return a hash code based on the contents of the specified array.
-
-
-
Method Detail
-
nullSafeEquals
public static boolean nullSafeEquals(java.lang.Object o1, java.lang.Object o2)
Determine if the given objects are equal, returningtrue
if both arenull
orfalse
if only one isnull
.Compares arrays with
Arrays.equals
, performing an equality check based on the array elements rather than the array reference.- Parameters:
o1
- first Object to compareo2
- second Object to compare- Returns:
- whether the given objects are equal
-
nullSafeHashCode
public static int nullSafeHashCode(java.lang.Object obj)
Return as hash code for the given object; typically the value ofObject#hashCode()
}. If the object is an array, this method will delegate to any of thenullSafeHashCode
methods for arrays in this class. If the object isnull
, this method returns 0.- Parameters:
obj
- the given object- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(java.lang.Object[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(boolean[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(byte[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(char[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(double[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(float[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(int[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(long[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
nullSafeHashCode
public static int nullSafeHashCode(short[] array)
Return a hash code based on the contents of the specified array. Ifarray
isnull
, this method returns 0.- Parameters:
array
- the specified array- Returns:
- a hash code value
-
-