java.lang.Object
io.lettuce.core.dynamic.support.GenericTypeResolver
public abstract class GenericTypeResolver extends Object
Helper class for resolving generic types against type variables.
Mainly intended for usage within the framework, resolving method parameter types even when they are declared generically.
-
Constructor Summary
Constructors Constructor Description GenericTypeResolver() -
Method Summary
Modifier and Type Method Description static Map<TypeVariable,Type>getTypeVariableMap(Class<?> clazz)static Class<?>[]resolveTypeArguments(Class<?> clazz, Class<?> genericIfc)Resolve the type arguments of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare concrete types for its type variables.
-
Constructor Details
-
GenericTypeResolver
public GenericTypeResolver()
-
-
Method Details
-
getTypeVariableMap
Build a mapping ofTypeVariable namestoconcrete classesfor the specifiedClass. Searches all super types, enclosing types and interfaces. -
resolveTypeArguments
Resolve the type arguments of the given generic interface against the given target class which is assumed to implement the generic interface and possibly declare concrete types for its type variables.- Parameters:
clazz- the target class to check againstgenericIfc- the generic interface or superclass to resolve the type argument from- Returns:
- the resolved type of each argument, with the array size matching the number of actual type arguments, or
nullif not resolvable
-