Class TypeList.Generic.ForDetachedTypes.OfTypeVariables.AttachedTypeVariable

    • Constructor Detail

      • AttachedTypeVariable

        protected AttachedTypeVariable​(TypeVariableSource typeVariableSource,
                                       TypeVariableToken typeVariableToken,
                                       TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
        Creates a new attached type variable.
        Parameters:
        typeVariableSource - The type variable's source.
        typeVariableToken - A token representing the type variable in its detached state.
        visitor - A visitor for attaching the type variable's bounds.
    • Method Detail

      • 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.
      • 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.
      • getDeclaredAnnotations

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