| java.lang.Object org.compass.core.util.ObjectUtils
ObjectUtils | abstract public class ObjectUtils (Code) | | Miscellaneous object utility methods. Mainly for internal use within the
framework; consider Jakarta's Commons Lang for a more comprehensive suite
of object utilities.
author: kimchy |
Method Summary | |
public static String | getIdentityHexString(Object o) Return a hex string form of an object's identity hash code. | public static boolean | isCheckedException(Throwable ex) Return whether the given throwable is a checked exception,
i.e. | public static boolean | isCompatibleWithThrowsClause(Throwable ex, Class[] declaredExceptions) Check whether the given exception is compatible with the exceptions
declared in a throws clause. | public static boolean | isEmpty(Object[] array) Return whether the given array is empty: that is, null or of zero length. | public 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. | public static Object[] | toObjectArray(Object primitiveArray) Convert a primitive array to an object array of primitive wrapper objects. |
getIdentityHexString | public static String getIdentityHexString(Object o)(Code) | | Return a hex string form of an object's identity hash code.
Parameters: o - the object the object's identity code in hex |
isCheckedException | public static boolean isCheckedException(Throwable ex)(Code) | | Return whether the given throwable is a checked exception,
i.e. an Exception but not a RuntimeException.
Parameters: ex - the throwable to check whether the throwable is a checked exception See Also: java.lang.Exception See Also: java.lang.RuntimeException |
isCompatibleWithThrowsClause | public static boolean isCompatibleWithThrowsClause(Throwable ex, Class[] declaredExceptions)(Code) | | Check whether the given exception is compatible with the exceptions
declared in a throws clause.
Parameters: ex - the exception to checked Parameters: declaredExceptions - the exceptions declared in the throws clause whether the given exception is compatible |
isEmpty | public static boolean isEmpty(Object[] array)(Code) | | Return whether the given array is empty: that is, null or of zero length.
Parameters: array - the array to check |
nullSafeEquals | public static boolean nullSafeEquals(Object o1, Object o2)(Code) | | Determine if the given objects are equal, returning true if both are null
or false if only one is null.
Parameters: o1 - first Object to compare Parameters: o2 - second Object to compare whether the given objects are equal |
toObjectArray | public static Object[] toObjectArray(Object primitiveArray)(Code) | | Convert a primitive array to an object array of primitive wrapper objects.
Parameters: primitiveArray - the primitive array the object array throws: IllegalArgumentException - if the parameter is not a primitive array |
|
|