Skip to content

Most visited

Recently visited

navigation
Added in API level 1

TypeVariable

public interface TypeVariable
implements Type

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


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

getBounds

Added in API level 1
Type[] getBounds ()

Returns the upper bounds of this type variable. Object is the implicit upper bound if no other bounds are declared.

Returns
Type[] 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

Added in API level 1
D getGenericDeclaration ()

Returns the language construct that declares this type variable.

Returns
D the generic declaration

getName

Added in API level 1
String getName ()

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

Returns
String the name of this type variable
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.