Class TypeDescription.Generic.OfTypeVariable.Symbolic

    • Field Detail

      • symbol

        private final java.lang.String symbol
        The symbol of the symbolic type variable.
      • annotationSource

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

      • Symbolic

        public Symbolic​(java.lang.String symbol,
                        AnnotationSource annotationSource)
        Creates a symbolic type variable.
        Parameters:
        symbol - The symbol of the symbolic type variable.
        annotationSource - The annotation source to query for the declared annotations.
    • Method Detail

      • getSort

        public TypeDefinition.Sort getSort()
        Returns the sort of the generic type this instance represents.
        Returns:
        The sort of the generic type.
      • 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.
      • 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.
      • getRecordComponents

        public RecordComponentList<RecordComponentDescription.InGenericShape> getRecordComponents()
        Returns the list of record components that are declared by this type. If this type is not a record, the returned list is empty.
        Returns:
        A list of record components that this type declares.
      • getTypeArguments

        public TypeList.Generic getTypeArguments()

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

        public TypeDescription.Generic findBindingOf​(TypeDescription.Generic typeVariable)

        Returns the parameter binding of the supplied type variable.

        This method must only be called for parameterized types (TypeDefinition.Sort.PARAMETERIZED). For all other types, this method throws an IllegalStateException.

        Parameters:
        typeVariable - The type variable for which a value should be located.
        Returns:
        The value that is bound to the supplied type variable or null if the type variable is not bound by this parameterized type.
      • getLowerBounds

        public TypeList.Generic getLowerBounds()

        Returns the lower bounds of this type.

        Only wildcard types (TypeDefinition.Sort.WILDCARD) define a lower bound. For other types, an IllegalStateException is thrown.

        Returns:
        The lower bounds of this type.
      • 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.
      • getTypeName

        public java.lang.String getTypeName()
        Returns the name of the type. For generic types, this name is their Object.toString() representations. For a non-generic type, it is the fully qualified binary name of the type.
        Returns:
        The name of this type.
      • getActualName

        public java.lang.String getActualName()
        Returns the name of this element as it is found in the source code. If no such name exists, an empty string is returned.
        Returns:
        The name of this element as given in a Java program's source code.
      • accept

        public <T> T accept​(TypeDescription.Generic.Visitor<T> visitor)
        Applies a visitor to this generic type description.
        Type Parameters:
        T - The value that this visitor yields.
        Parameters:
        visitor - The visitor to apply.
        Returns:
        The visitor's return value.
      • getStackSize

        public StackSize getStackSize()
        Returns the size of the type described by this instance. Wildcard types (TypeDefinition.Sort.WILDCARD do not have a well-defined a stack size and cause an IllegalStateException to be thrown.
        Returns:
        The size of the type described by this instance.
      • isArray

        public boolean isArray()
        Checks if the type described by this entity is an array.
        Returns:
        true if this type description represents an array.
      • isPrimitive

        public boolean isPrimitive()
        Checks if the type described by this entity is a primitive type.
        Returns:
        true if this type description represents a primitive type.
      • isRecord

        public boolean isRecord()
        Checks if this type is a Java record.
        Returns:
        true if this type is a Java record.
      • 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.AbstractBase
        Parameters:
        type - The type of interest.
        Returns:
        true if the type described by this instance represents type.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object