Class TypeHierarchy.MethodVariables

java.lang.Object
io.micronaut.sourcegen.model.TypeHierarchy.MethodVariables
Enclosing class:
TypeHierarchy

public static final class TypeHierarchy.MethodVariables extends Object
The variables a generic method of an inherited type declares of its own, in the scope of the type: they shadow the type's variables of the same name, and are bound by nothing the type is inherited with.

A substituted type names each by a name of its own, which no variable of a type has - so that it is never taken for a variable of the same name a type argument names - and with its bounds, the type arguments substituted, so that it erases as the override's declaration does. One declared without bounds is bounded by Object.

Since:
2.3
  • Method Details

    • substitute

      public TypeDef substitute(TypeDef type)
      Substitutes the type arguments the type is inherited with, and the variables of the method by their own names.
      Parameters:
      type - A type in the scope of the method
      Returns:
      The substituted type
    • nameOf

      public String nameOf(String declared)
      Parameters:
      declared - The name a variable of the method is declared with
      Returns:
      The name a substituted type names it by
    • isMethodVariable

      public boolean isMethodVariable(String name)
      Parameters:
      name - The name of a variable a substituted type names
      Returns:
      Whether it is a variable of the method