Class TypeVariableReferenceType

All Implemented Interfaces:
AnnotatedElement, Traceable, TypeVariableDeclaringElement, TypeVariableReference

public class TypeVariableReferenceType extends ReferenceType implements TypeVariableReference
ReferenceType pointing to a type variable. The delegate for this reference type is the upperbound on the type variable (so Object if not otherwise specified).
Author:
Adrian Colyer, Andy Clement
  • Constructor Details

    • TypeVariableReferenceType

      public TypeVariableReferenceType(TypeVariable typeVariable, World world)
  • Method Details

    • equals

      public boolean equals(Object other)
      Description copied from class: UnresolvedType
      Equality is checked based on the underlying signature.
      Overrides:
      equals in class ResolvedType
    • hashCode

      public int hashCode()
      Description copied from class: UnresolvedType
      Equality is checked based on the underlying signature, so the hash code of a particular type is the hash code of its signature string.
      Overrides:
      hashCode in class UnresolvedType
    • getDelegate

      public ReferenceTypeDelegate getDelegate()
      For a TypeVariableReferenceType the delegate is the delegate for the first bound.
      Overrides:
      getDelegate in class ReferenceType
    • parameterize

      public UnresolvedType parameterize(Map<String,​UnresolvedType> typeBindings)
      Description copied from class: ResolvedType
      Iff I am a parameterized type, and any of my parameters are type variable references (or nested parameterized types), return a version with those type parameters replaced in accordance with the passed bindings.
      Overrides:
      parameterize in class ResolvedType
    • getTypeVariable

      public TypeVariable getTypeVariable()
      Specified by:
      getTypeVariable in interface TypeVariableReference
    • isTypeVariableReference

      public boolean isTypeVariableReference()
      Overrides:
      isTypeVariableReference in class UnresolvedType
    • toString

      public String toString()
      Description copied from class: UnresolvedType
      Returns a java language string representation of this type.
      Overrides:
      toString in class UnresolvedType
    • isGenericWildcard

      public boolean isGenericWildcard()
      Overrides:
      isGenericWildcard in class UnresolvedType
    • isAnnotation

      public boolean isAnnotation()
      Description copied from class: ResolvedType
      Note: Only overridden by Name subtype.
      Overrides:
      isAnnotation in class ReferenceType
    • getSignature

      public String getSignature()
      return the signature for a *REFERENCE* to a type variable, which is simply: Tname; there is no bounds info included, that is in the signature of the type variable itself
      Overrides:
      getSignature in class UnresolvedType
      Returns:
      the java JVM signature string for this type.
    • getTypeVariableName

      public String getTypeVariableName()
      Returns:
      the name of the type variable
    • getUpperBound

      public ReferenceType getUpperBound()
    • resolve

      public ResolvedType resolve(World world)
      resolve the type variable we are managing and then return this object. 'this' is already a ResolvedType but the type variable may transition from a not-resolved to a resolved state.
      Overrides:
      resolve in class UnresolvedType
      Parameters:
      world - the World within which to resolve.
      Returns:
      a resolved type representing this type in the appropriate world.
    • isTypeVariableResolved

      public boolean isTypeVariableResolved()
      Returns:
      true if the type variable this reference is managing is resolved