Class GenericUtils

java.lang.Object
io.micronaut.annotation.processing.GenericUtils

@Internal public class GenericUtils extends Object
Utility methods for dealing with generic type signatures.
Author:
Graeme Rocher
  • Constructor Details

  • Method Details

    • interfaceGenericTypesFor

      public List<? extends TypeMirror> interfaceGenericTypesFor(TypeElement element, String interfaceName)
      Finds the generic types for the given interface for the given class element.
      Parameters:
      element - The class element
      interfaceName - The interface
      Returns:
      The generic types or an empty list
    • resolveTypeReference

      protected TypeMirror resolveTypeReference(TypeMirror mirror, Map<String,TypeMirror> boundTypes)
      Resolve a type reference to use for the given type mirror taking into account generic type variables.
      Parameters:
      mirror - The mirror
      boundTypes - The already bound types for any type variable
      Returns:
      A type reference
    • resolveBoundTypes

      protected Map<String,TypeMirror> resolveBoundTypes(DeclaredType type)
      Resolve bound types for the given declared type.
      Parameters:
      type - The declaring type
      Returns:
      The type bounds