public class TypeHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeHelper.GenericField |
static interface |
TypeHelper.ObjFactory<T> |
| Constructor and Description |
|---|
TypeHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Optional<Type> |
asType(Type toCheck,
Class against) |
static Optional<Type[]> |
asTypeArgs(Type toCheck,
Class against) |
static <T> TypeHelper.ObjFactory<T> |
constructorOf(Class<T> t) |
static TypeHelper.GenericField[] |
getDeclaredFields(Type type) |
static Object |
getFieldValue(Object obj,
String name) |
static Type[] |
getGenericInterfaces(Type type) |
static Type |
getGenericParent(ParameterizedType childRawType,
Type parent) |
static Type |
getGenericSuperclass(Type type) |
static TypeVariable[] |
getTypeArguments(Type type) |
static boolean |
isArray(Type a) |
static boolean |
isAssignableFrom(Type a,
Type b) |
static boolean |
isBoxedOrPrimitive(Type from) |
static boolean |
isEnum(Type a) |
static Optional<Class> |
rawClass(Type type) |
static void |
setFieldValue(Object obj,
String name,
Object value) |
static Class<?> |
toClass(Type type)
Converts a Type to a Class, if possible.
|
static String |
toPrimitiveName(Type from) |
public static Class<?> toClass(Type type)
public static <T> TypeHelper.ObjFactory<T> constructorOf(Class<T> t)
public static TypeHelper.GenericField[] getDeclaredFields(Type type)
public static Type getGenericParent(ParameterizedType childRawType, Type parent)
public static TypeVariable[] getTypeArguments(Type type)
public static boolean isArray(Type a)
public static boolean isEnum(Type a)
public static boolean isBoxedOrPrimitive(Type from)
Copyright © 2026 vpc open source initiative. All rights reserved.