public class ObjectHelper extends Object
| Constructor and Description |
|---|
ObjectHelper() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
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 <T> T |
getException(Class<T> type,
Throwable exception)
Retrieves the given exception type from the exception.
|
public static <T> T getException(Class<T> type, Throwable exception)
type - the exception type wanted to retrieveexception - the caused exceptionpublic static Iterator<Throwable> createExceptionIterator(Throwable exception)
exception - the exceptionpublic static <T> T cast(Class<T> toType, Object value)
Copyright © 2003–2019 eXo Platform SAS. All rights reserved.