Interface GenericPlaceholderElement

  • All Superinterfaces:
    io.micronaut.core.annotation.AnnotatedElement, io.micronaut.core.annotation.AnnotationMetadata, io.micronaut.core.annotation.AnnotationMetadataDelegate, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, ClassElement, io.micronaut.core.naming.Described, Element, io.micronaut.core.naming.Named, TypedElement

    public interface GenericPlaceholderElement
    extends ClassElement
    Represents a generic placeholder in source code. A placeholder is a generic type that has not yet had the type bound yet – List<T> has a generic placeholder, whilst List<String> does not.

    For compatibility, this a GenericPlaceholderElement acts like its first upper bound when used as a ClassElement.

    Since:
    3.1.0
    • Method Detail

      • getBounds

        @NonNull
        java.util.List<? extends ClassElement> getBounds()
        Returns the bounds of this the generic placeholder empty. Always returns a non-empty list.
        Returns:
        The bounds declared for this type variable.
      • getVariableName

        @NonNull
        java.lang.String getVariableName()
        Returns:
        The name of the placeholder variable.
      • getDeclaringElement

        java.util.Optional<Element> getDeclaringElement()
        Returns:
        The element declaring this variable, if it can be determined. Must be either a method or a class.