Class TypeDescription.Generic.OfNonGenericType.Latent

    • Field Detail

      • typeDescription

        private final TypeDescription typeDescription
        The non-generic type's raw type.
      • annotationSource

        private final AnnotationSource annotationSource
        The annotation source to query for the declared annotations.
    • Constructor Detail

      • Latent

        public Latent​(TypeDescription typeDescription,
                      AnnotationSource annotationSource)
        Creates a non-generic type with an implicit owner type.
        Parameters:
        typeDescription - The non-generic type's raw type.
        annotationSource - The annotation source to query for the declared annotations.
      • Latent

        private Latent​(TypeDescription typeDescription,
                       TypeDescription declaringType,
                       AnnotationSource annotationSource)
        Creates a non-generic type with a raw owner type.
        Parameters:
        typeDescription - The non-generic type's raw type.
        declaringType - The non-generic type's declaring type.
        annotationSource - The annotation source to query for the declared annotations.
      • Latent

        protected Latent​(TypeDescription typeDescription,
                         TypeDescription.Generic declaringType,
                         AnnotationSource annotationSource)
        Creates a non-generic type.
        Parameters:
        typeDescription - The non-generic type's raw type.
        declaringType - The non-generic type's declaring type.
        annotationSource - The annotation source to query for the declared annotations.
    • Method Detail

      • getOwnerType

        public TypeDescription.Generic getOwnerType()

        Returns the owner type of this type. A type's owner type describes a nested type's declaring type. If it exists, the returned type can be a non-generic or parameterized type. If a class has no declaring type, null is returned.

        An owner type is only well-defined for parameterized types (TypeDefinition.Sort.PARAMETERIZED), for non-generic types (TypeDefinition.Sort.NON_GENERIC) and for generic arrays (TypeDefinition.Sort.GENERIC_ARRAY). For all other types, this method throws an IllegalStateException.

        Returns:
        This type's owner type or null if no owner type exists.
      • getDeclaredAnnotations

        public AnnotationList getDeclaredAnnotations()
        Returns a list of annotations that are declared by this instance.
        Returns:
        A list of declared annotations.
      • asErasure

        public TypeDescription asErasure()
        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.