Skip to content

Most visited

Recently visited

navigation
Added in API level 1

ParameterizedType

public interface ParameterizedType
implements Type

java.lang.reflect.ParameterizedType


This interface represents a parameterized type such as 'Set<String>'.

Summary

Public methods

abstract Type[] getActualTypeArguments()

Returns an array of the actual type arguments for this type.

abstract Type getOwnerType()

Returns the parent / owner type, if this type is an inner type, otherwise null is returned if this is a top-level type.

abstract Type getRawType()

Returns the declaring type of this parameterized type.

Public methods

getActualTypeArguments

Added in API level 1
Type[] getActualTypeArguments ()

Returns an array of the actual type arguments for this type.

If this type models a non parameterized type nested within a parameterized type, this method returns a zero length array. The generic type of the following field declaration is an example for a parameterized type without type arguments.

 A<String>.B field;

 class A<T> {
     class B {
     }
 }

Returns
Type[] the actual type arguments
Throws
TypeNotPresentException if one of the type arguments cannot be found
MalformedParameterizedTypeException if one of the type arguments cannot be instantiated for some reason

getOwnerType

Added in API level 1
Type getOwnerType ()

Returns the parent / owner type, if this type is an inner type, otherwise null is returned if this is a top-level type.

Returns
Type the owner type or null if this is a top-level type
Throws
TypeNotPresentException if one of the type arguments cannot be found
MalformedParameterizedTypeException if the owner type cannot be instantiated for some reason

getRawType

Added in API level 1
Type getRawType ()

Returns the declaring type of this parameterized type.

The raw type of Set field; is Set.

Returns
Type the raw type of this parameterized type
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.