|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.social.common.service.utils.ObjectHelper
public class ObjectHelper
| Constructor Summary | |
|---|---|
ObjectHelper()
|
|
| Method Summary | ||
|---|---|---|
static String |
asString(Object[] objects)
Turns the given object arrays into a meaningful string |
|
static
|
cast(Class<T> toType,
Object value)
Converts the given value to the required type or throw a meaningful exception |
|
static Class<?> |
convertPrimitiveTypeToWrapperType(Class<?> type)
Converts primitive types such as int to its wrapper type like Integer |
|
static Iterator<Throwable> |
createExceptionIterator(Throwable exception)
Creates an iterator to walk the exception from the bottom up (the last caused by going upwards to the root exception). |
|
static
|
getException(Class<T> type,
Throwable exception)
Retrieves the given exception type from the exception. |
|
static boolean |
isAssignableFrom(Class<?> a,
Class<?> b)
Returns true if a class is assignable from another class like the Class.isAssignableFrom(Class) method but which also includes
coercion between primitive types to deal with Java 5 primitive type
wrapping |
|
static boolean |
isPrimitiveArrayType(Class<?> clazz)
Returns if the given clazz type is a Java primitive array type. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectHelper()
| Method Detail |
|---|
public static <T> T getException(Class<T> type,
Throwable exception)
type - the exception type wanted to retrieveexception - the caused exception
public static Iterator<Throwable> createExceptionIterator(Throwable exception)
exception - the exception
public static String asString(Object[] objects)
objects - an array of objects or null
public static boolean isAssignableFrom(Class<?> a,
Class<?> b)
Class.isAssignableFrom(Class) method but which also includes
coercion between primitive types to deal with Java 5 primitive type
wrapping
public static boolean isPrimitiveArrayType(Class<?> clazz)
clazz type is a Java primitive array type.
clazz - the Java type to be checked
true if the given type is a Java primitive array type
public static <T> T cast(Class<T> toType,
Object value)
public static Class<?> convertPrimitiveTypeToWrapperType(Class<?> type)
Integer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||