Class TypeHierarchy.InheritedType

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

public static final class TypeHierarchy.InheritedType extends Object
A type of the hierarchy with the type arguments it is inherited with.
Since:
2.3
  • Method Details

    • isRaw

      public boolean isRaw()
      Returns:
      Whether the type is inherited raw, directly or through a raw supertype: its members are erased, and its type variables are bound to nothing
    • getName

      public String getName()
      Returns:
      The binary name
    • getPackageName

      public String getPackageName()
      Returns:
      The package name. A type named without one - a member type named by its simple name, as the definition the caller holds on to names it - is of the package of the definition whose hierarchy it is
    • getTypeParameters

      public List<String> getTypeParameters()
      Returns:
      The names of the type variables the type declares
    • getBounds

      public List<TypeDef> getBounds(String variableName)
      Parameters:
      variableName - The name of a type variable the type declares
      Returns:
      All the bounds it is declared with - `CharSequence` and `Serializable` for `V extends CharSequence invalid input: '&' Serializable` - or none
    • substitute

      public TypeDef substitute(TypeDef type)
      Substitutes the type arguments this type is inherited with.
      Parameters:
      type - A type in the scope of this type
      Returns:
      The substituted type
    • substitute

      public TypeDef substitute(TypeDef type, List<TypeDef.TypeVariable> shadowed)
      Substitutes the type arguments this type is inherited with, except for variables a generic method declares of its own, which shadow the type's variables of the same name.
      Parameters:
      type - A type in the scope of a method of this type
      shadowed - The variables the method declares
      Returns:
      The substituted type
      See Also:
    • shadowedBy

      The scope of a generic method of this type, whose variables shadow the type's variables of the same name.
      Parameters:
      shadowed - The variables the method declares
      Returns:
      The scope
    • erase

      public TypeDef erase(TypeDef type)
      Erases a type in the scope of this type.
      Parameters:
      type - The type
      Returns:
      The erased type
    • erase

      public TypeDef erase(TypeDef type, TypeHierarchy.InheritedType boundOwner)
      Erases a type in the scope of this type, taking the bounds of its type variables from another type - the declaring definition, for a type already substituted into its scope.
      Parameters:
      type - The type
      boundOwner - The type declaring the variables
      Returns:
      The erased type