|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.util.ObjectUtils
public abstract class ObjectUtils
Miscellaneous object utility methods. Mainly for internal use within the framework; consider Jakarta's Commons Lang for a more comprehensive suite of object utilities.
org.apache.commons.lang.ObjectUtils
Constructor Summary | |
---|---|
ObjectUtils()
|
Method Summary | |
---|---|
static Object[] |
addObjectToArray(Object[] array,
Object obj)
Append the given Object to the given array, returning a new array consisting of the input array contents plus the given Object. |
static String |
getIdentityHexString(Object obj)
Return a hex string form of an object's identity hash code. |
static boolean |
isCheckedException(Throwable ex)
Return whether the given throwable is a checked exception: that is, neither a RuntimeException nor an Error. |
static boolean |
isCompatibleWithThrowsClause(Throwable ex,
Class[] declaredExceptions)
Check whether the given exception is compatible with the exceptions declared in a throws clause. |
static boolean |
isEmpty(Object[] array)
Return whether the given array is empty: that is, null
or of zero length. |
static boolean |
nullSafeEquals(Object o1,
Object o2)
Determine if the given objects are equal, returning true if both are null or false if only one is null. |
static Object[] |
toObjectArray(Object source)
Convert the given array (which may be a primitive array) to an object array (if necessary of primitive wrapper objects). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectUtils()
Method Detail |
---|
public static boolean nullSafeEquals(Object o1, Object o2)
o1
- first Object to compareo2
- second Object to compare
public static String getIdentityHexString(Object obj)
obj
- the object
public static boolean isCheckedException(Throwable ex)
ex
- the throwable to check
Exception
,
RuntimeException
,
Error
public static boolean isCompatibleWithThrowsClause(Throwable ex, Class[] declaredExceptions)
ex
- the exception to checkeddeclaredExceptions
- the exceptions declared in the throws clause
public static boolean isEmpty(Object[] array)
null
or of zero length.
array
- the array to checkpublic static Object[] addObjectToArray(Object[] array, Object obj)
array
- the array to append to (can be null
)obj
- the Object to append
null
)public static Object[] toObjectArray(Object source)
A null
source value will be converted to an
empty Object array.
source
- the (potentially primitive) array
IllegalArgumentException
- if the parameter is not an array
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |