Interface TypeVariable<D extends GenericDeclaration>

Type Parameters:
D - the generic declaration that declares this type variable
All Superinterfaces:
Type
All Known Implementing Classes:
TypeVariableImpl

public interface TypeVariable<D extends GenericDeclaration>
extends Type
This interface represents a type variables such as 'T' in 'public interface Comparable<T>', the bounded 'T' in 'public interface A<T extends Number>' or the multiple bounded 'T' in 'public interface B<T extends Number & Cloneable>'.
Since:
1.5
  • Method Summary

    Modifier and Type Method Description
    Type[] getBounds()
    Returns the upper bounds of this type variable.
    D getGenericDeclaration()
    Returns the language construct that declares this type variable.
    String getName()
    Returns the name of this type variable as it is specified in source code.
  • Method Details

    • getBounds

      Type[] getBounds()
      Returns the upper bounds of this type variable. Object is the implicit upper bound if no other bounds are declared.
      Returns:
      the upper bounds of this type variable
      Throws:
      TypeNotPresentException - if any of the bounds points to a missing type
      MalformedParameterizedTypeException - if any of the bounds points to a type that cannot be instantiated for some reason
    • getGenericDeclaration

      D getGenericDeclaration()
      Returns the language construct that declares this type variable.
      Returns:
      the generic declaration
    • getName

      String getName()
      Returns the name of this type variable as it is specified in source code.
      Returns:
      the name of this type variable