Class TypeDescription.Generic.OfParameterizedType.ForLoadedType

    • Constructor Detail

      • ForLoadedType

        public ForLoadedType​(java.lang.reflect.ParameterizedType parameterizedType)
        Creates a description of the loaded parameterized type.
        Parameters:
        parameterizedType - The represented parameterized type.
      • ForLoadedType

        protected ForLoadedType​(java.lang.reflect.ParameterizedType parameterizedType,
                                TypeDescription.Generic.AnnotationReader annotationReader)
        Creates a description of the loaded parameterized type.
        Parameters:
        parameterizedType - The represented parameterized type.
        annotationReader - The annotation reader to query for the parameterized type's annotations.
    • Method Detail

      • getTypeArguments

        public TypeList.Generic getTypeArguments()
        Description copied from interface: TypeDescription.Generic

        Returns the type arguments of this type.

        Parameters are only well-defined for parameterized types (TypeDefinition.Sort.PARAMETERIZED). For all other types, this method throws an IllegalStateException.

        Returns:
        A list of this type's type parameters.
      • asErasure

        public TypeDescription asErasure()
        Description copied from interface: TypeDefinition
        Returns the erasure of this type. Wildcard types (TypeDefinition.Sort.WILDCARD) do not have a well-defined erasure and cause an IllegalStateException to be thrown.
        Returns:
        The erasure of this type.
      • getDeclaredAnnotations

        public AnnotationList getDeclaredAnnotations()
        Description copied from interface: AnnotationSource
        Returns a list of annotations that are declared by this instance.
        Returns:
        A list of declared annotations.