Since: API Level 1
public interface

TypeVariable

implements Type
java.lang.reflect.TypeVariable<D extends java.lang.reflect.GenericDeclaration>

Class Overview

This interface represents a type variables such as 'T' in 'public interface Comparable', the bounded 'T' in 'public interface A' or the multiple bounded 'T' in 'public interface B'.

Summary

Public Methods
abstract Type[] getBounds()
Returns the upper bounds of this type variable.
abstract D getGenericDeclaration()
Returns the language construct that declares this type variable.
abstract String getName()
Returns the name of this type variable as it is specified in source code.

Public Methods

public abstract Type[] getBounds ()

Since: API Level 1

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

public abstract D getGenericDeclaration ()

Since: API Level 1

Returns the language construct that declares this type variable.

Returns
  • the generic declaration

public abstract String getName ()

Since: API Level 1

Returns the name of this type variable as it is specified in source code.

Returns
  • the name of this type variable