public abstract class ObjectUtils
extends java.lang.Object
(This class is a member of the Spring Framework.)
Miscellaneous object utility methods.| Constructor | Description |
|---|---|
ObjectUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static boolean |
nullSafeEquals(java.lang.Object o1,
java.lang.Object o2) |
Determine if the given objects are equal, returning
true if
both are null or false if only one is null. |
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.
|
public static boolean nullSafeEquals(java.lang.Object o1,
java.lang.Object o2)
true if
both are null or false if only one is null.
Compares arrays with Arrays.equals, performing an equality
check based on the array elements rather than the array reference.
o1 - first Object to compareo2 - second Object to comparepublic static int nullSafeHashCode(java.lang.Object obj)
Object#hashCode()}. If the object is an array,
this method will delegate to any of the nullSafeHashCode
methods for arrays in this class. If the object is null,
this method returns 0.obj - the given objectpublic static int nullSafeHashCode(java.lang.Object[] array)
array is null, this method returns 0.array - the specified arraypublic static int nullSafeHashCode(boolean[] array)
array is null, this method returns 0.array - the specified arraypublic static int nullSafeHashCode(byte[] array)
array is null, this method returns 0.array - the specified arraypublic static int nullSafeHashCode(char[] array)
array is null, this method returns 0.array - the specified arraypublic static int nullSafeHashCode(double[] array)
array is null, this method returns 0.array - the specified arraypublic static int nullSafeHashCode(float[] array)
array is null, this method returns 0.array - the specified arraypublic static int nullSafeHashCode(int[] array)
array is null, this method returns 0.array - the specified arraypublic static int nullSafeHashCode(long[] array)
array is null, this method returns 0.array - the specified arraypublic static int nullSafeHashCode(short[] array)
array is null, this method returns 0.array - the specified arrayCopyright © 2008–2018 The Aspectran Project. All rights reserved.