Class TypeVariableBinder

java.lang.Object
io.micronaut.inject.ast.TypeVariableBinder

@Internal public final class TypeVariableBinder extends Object
Binds the type variables a super type leaves in the arguments it reports for the types above it, for ClassElement.getAllTypeArguments() and the language implementations that walk their super types themselves.
Since:
5.2.2
Author:
Micronaut
  • Method Details

    • bind

      Replaces the type variables named in the bindings, all at once, so a variable a binding introduces is never replaced again: [K, V] bound with {K=V, V=K} gives [V, K].

      The arguments passed in must be the ones the type declares, written in its own variables, not ones a caller resolved already: a resolved argument bound a second time is replaced again, and swaps back whenever the variable names of the two types collide.

      Parameters:
      typeArguments - The type arguments to bind
      bindings - The types bound to the variables, by variable name
      Returns:
      The bound type arguments, the same map if no variable was bound