Class TypeDescription.Generic.OfTypeVariable.ForLoadedType

    • Field Detail

      • typeVariable

        private final java.lang.reflect.TypeVariable<?> typeVariable
        The represented type variable.
    • Constructor Detail

      • ForLoadedType

        public ForLoadedType​(java.lang.reflect.TypeVariable<?> typeVariable)
        Creates a description of a loaded type variable.
        Parameters:
        typeVariable - The represented type variable.
      • ForLoadedType

        protected ForLoadedType​(java.lang.reflect.TypeVariable<?> typeVariable,
                                TypeDescription.Generic.AnnotationReader annotationReader)
        Creates a description of a loaded type variable with an annotation.
        Parameters:
        typeVariable - The represented type variable.
        annotationReader - The annotation reader to query for the variable's annotations.
    • Method Detail

      • getTypeVariableSource

        public TypeVariableSource getTypeVariableSource()
        Returns the source of this type variable. A type variable source is only well-defined for an attached type variable (TypeDefinition.Sort.VARIABLE. For other types, this method throws an IllegalStateException.
        Returns:
        This type's type variable source.
      • getUpperBounds

        public TypeList.Generic getUpperBounds()

        Returns the upper bounds of this type. Any type with a well-defined upper bound is bound by at least one type. If no such type is defined, the bound is implicitly Object.

        Only non-symbolic type variables (TypeDefinition.Sort.VARIABLE, and wildcard types (TypeDefinition.Sort.WILDCARD) have well-defined upper bounds. For other types, an IllegalStateException is thrown.

        Returns:
        The upper bounds of this type.
      • getDeclaredAnnotations

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

        public boolean represents​(java.lang.reflect.Type type)
        Checks if the type described by this instance represents type.
        Specified by:
        represents in interface TypeDefinition
        Overrides:
        represents in class TypeDescription.Generic.OfTypeVariable
        Parameters:
        type - The type of interest.
        Returns:
        true if the type described by this instance represents type.