public final class ClassUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
createInstance(Class<T> instanceType,
Object... args) |
static <T> Class<?>[] |
findParameterTypes(Class<T> instanceType) |
static <T> Constructor<T> |
getConstructor(Class<T> instanceType,
Object... args)
Get Constructor for give parameters
|
static <T> T |
getGenericType(Class<?> type)
Get Generic Type at first index
|
static <T> T |
getGenericType(Class<?> type,
int index) |
static <T> T |
getGenericType(Type type)
Get Generic Type of given type
|
static <T> T |
getGenericType(Type type,
int index)
Get Generic Type of given type by give index
|
static <T> Class<T> |
getParameterType(Class<?> instanceType)
get Parameter Type for Class type
|
static <T> Class<T> |
getParameterType(Class<?> instanceType,
int index)
get Parameter Type for Class type by given index
|
static <T> boolean |
isCollectionType(Class<T> type) |
static boolean |
isComplexType(Class<?> type) |
static boolean |
isPrimitiveOrWrapper(Class<?> type) |
static boolean |
isPrimitiveWrapper(Class<?> type) |
public static boolean isComplexType(Class<?> type)
public static <T> boolean isCollectionType(Class<T> type)
public static boolean isPrimitiveOrWrapper(Class<?> type)
public static boolean isPrimitiveWrapper(Class<?> type)
public static <T> T createInstance(Class<T> instanceType, Object... args)
T - required typeinstanceType - may be not nullargs - may be emptypublic static <T> Class<?>[] findParameterTypes(Class<T> instanceType)
T - required typeinstanceType - may not be nullpublic static <T> Class<T> getParameterType(Class<?> instanceType)
T - required typeinstanceType - may not be nullpublic static <T> Class<T> getParameterType(Class<?> instanceType, int index)
T - required typeinstanceType - may not be nullindex - may not be negativepublic static <T> Constructor<T> getConstructor(Class<T> instanceType, Object... args)
T - required typeinstanceType - may not be nullargs - may emptypublic static <T> T getGenericType(Class<?> type)
T - required typetype - should not be nullpublic static <T> T getGenericType(Class<?> type, int index)
T - required typetype - Class Typeindex - may be not negativepublic static <T> T getGenericType(Type type)
T - required typetype - my not be nullpublic static <T> T getGenericType(Type type, int index)
T - required typetype - may not be nullindex - may be not negativeCopyright © 2018 Mario Tema. All rights reserved.