use of org.jboss.jandex.TypeVariable in project wildfly-swarm by wildfly-swarm.
the class TypeResolver method buildParamTypeResolutionMap.
private static Map<String, Type> buildParamTypeResolutionMap(ClassInfo klazz, ParameterizedType parameterizedType) {
List<TypeVariable> typeVariables = klazz.typeParameters();
List<Type> arguments = parameterizedType.arguments();
if (arguments.size() != typeVariables.size()) {
LOG.errorv("Unanticipated mismatch between type arguments and type variables \n" + "Args: {0}\n Vars:{1}", arguments, typeVariables);
}
Map<String, Type> resolutionMap = new LinkedHashMap<>();
for (int i = 0; i < arguments.size(); i++) {
TypeVariable typeVar = typeVariables.get(i);
Type arg = arguments.get(i);
resolutionMap.put(typeVar.identifier(), arg);
}
return resolutionMap;
}
Aggregations