Class TypePool.Default.LazyTypeDescription.TokenizedGenericType

    • Field Detail

      • typePool

        private final TypePool typePool
        The type pool to use for locating referenced types.
      • rawTypeDescriptor

        private final java.lang.String rawTypeDescriptor
        A descriptor of the generic type's raw type.
      • typeVariableSource

        private final TypeVariableSource typeVariableSource
        The closest type variable source of this generic type's declaration context.
    • Constructor Detail

      • TokenizedGenericType

        protected TokenizedGenericType​(TypePool typePool,
                                       TypePool.Default.LazyTypeDescription.GenericTypeToken genericTypeToken,
                                       java.lang.String rawTypeDescriptor,
                                       java.util.Map<java.lang.String,​java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens,
                                       TypeVariableSource typeVariableSource)
        Creates a new tokenized generic type.
        Parameters:
        typePool - The type pool to use for locating referenced types.
        genericTypeToken - The token that describes the represented generic type.
        rawTypeDescriptor - A descriptor of the generic type's erasure.
        annotationTokens - The tokenized type's type annotation tokens.
        typeVariableSource - The closest type variable source of this generic type's declaration context.
    • Method Detail

      • of

        protected static TypeDescription.Generic of​(TypePool typePool,
                                                    TypePool.Default.LazyTypeDescription.GenericTypeToken genericTypeToken,
                                                    java.lang.String rawTypeDescriptor,
                                                    java.util.Map<java.lang.String,​java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens,
                                                    TypeVariableSource typeVariableSource)
        Creates a new generic type description for a tokenized generic type.
        Parameters:
        typePool - The type pool to use for locating referenced types.
        genericTypeToken - The token that describes the represented generic type.
        rawTypeDescriptor - A descriptor of the generic type's erasure.
        annotationTokens - The tokenized type's type annotation tokens or null if no such annotations are defined.
        typeVariableSource - The closest type variable source of this generic type's declaration context.
        Returns:
        A suitable generic type.
      • toErasure

        protected static TypeDescription toErasure​(TypePool typePool,
                                                   java.lang.String descriptor)
        Creates a type description from a descriptor by looking up the corresponding type.
        Parameters:
        typePool - The type pool to use for locating a type.
        descriptor - The descriptor to interpret.
        Returns:
        A description of the type represented by the descriptor.
      • asErasure

        @Enhance("erasure")
        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.
      • getDeclaredAnnotations

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