Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
Added in API level 1
public interface

ParameterizedType

implements Type
java.lang.reflect.ParameterizedType

Class Overview

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

public abstract Type[] getActualTypeArguments ()

Added in API level 1

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
  • 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

public abstract Type getOwnerType ()

Added in API level 1

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

Returns
  • 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

public abstract Type getRawType ()

Added in API level 1

Returns the declaring type of this parameterized type.

The raw type of Set field; is Set .

Returns
  • the raw type of this parameterized type