public class GenericType extends ReifiedType
Constructor and Description |
---|
GenericType(Class clazz,
GenericType... parameters) |
GenericType(Type type) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
ReifiedType |
getActualTypeArgument(int i)
Return a type parameter for this type.
|
static GenericType |
parse(String rawType,
Object loader) |
int |
size()
Return the number of type parameters for this type.
|
String |
toString() |
getRawClass
public GenericType(Type type)
public GenericType(Class clazz, GenericType... parameters)
public static GenericType parse(String rawType, Object loader) throws ClassNotFoundException, IllegalArgumentException
public ReifiedType getActualTypeArgument(int i)
ReifiedType
i
.
For example, in the following example:
Map<String, ? extends Metadata>type parameter 0 is
String
, and type parameter 1 is
Metadata
.
This implementation returns a Reified Type that has Object
as class. Any object is assignable to Object and therefore no conversion
is then necessary. This is compatible with versions of Java language
prior to Java 5.
This method should be overridden by a subclass that provides access to
the generic type parameter information for Java 5 and later.
getActualTypeArgument
in class ReifiedType
i
- The zero-based index of the requested type parameter.ReifiedType
for the generic type parameter at
the specified index.public int size()
ReifiedType
This implementation returns 0
. This method should be
overridden by a subclass that provides access to the generic type
parameter information for Java 5 and later.
size
in class ReifiedType
Copyright © 2013. All rights reserved.