public class ParameterizedTypeImpl extends Object implements ParameterizedType
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object o)
From the JavaDoc for java.lang.reflect.ParameterizedType
"Instances of classes that implement this interface must
implement an equals() method that equates any two instances
that share the same generic type declaration and have equal
type parameters."
|
Type[] |
getActualTypeArguments()
Returns an array of
Type objects representing the actual type
arguments to this type. |
Type |
getOwnerType()
Returns a
Type object representing the type that this type
is a member of. |
Class<?> |
getRawType()
Returns the
Type object representing the class or interface
that declared this type. |
int |
hashCode() |
static ParameterizedTypeImpl |
make(Class<?> rawType,
Type[] actualTypeArguments,
Type ownerType)
Static factory.
|
getTypeNamepublic static ParameterizedTypeImpl make(Class<?> rawType, Type[] actualTypeArguments, Type ownerType)
This method throws a MalformedParameterizedTypeException
under the following circumstances:
If the number of actual type arguments (i.e., the size of the
array typeArgs) does not correspond to the number of
formal type arguments.
If any of the actual type arguments is not an instance of the
bounds on the corresponding formal.
rawType - the Class representing the generic type declaration being
instantiatedactualTypeArguments - a (possibly empty) array of types
representing the actual type arguments to the parameterized typeownerType - the enclosing type, if known.ParameterizedTypeMalformedParameterizedTypeException - if the instantiation
is invalidpublic Type[] getActualTypeArguments()
Type objects representing the actual type
arguments to this type.
Note that in some cases, the returned array be empty. This can occur if this type represents a non-parameterized type nested within a parameterized type.
getActualTypeArguments 在接口中 ParameterizedTypeType objects representing the actual type
arguments to this typeTypeNotPresentException - if any of the
actual type arguments refers to a non-existent type declarationMalformedParameterizedTypeException - if any of the
actual type parameters refer to a parameterized type that cannot
be instantiated for any reasonpublic Class<?> getRawType()
Type object representing the class or interface
that declared this type.getRawType 在接口中 ParameterizedTypeType object representing the class or interface
that declared this typepublic Type getOwnerType()
Type object representing the type that this type
is a member of. For example, if this type is O<T>.I<S>,
return a representation of O<T>.
If this type is a top-level type, null is returned.
getOwnerType 在接口中 ParameterizedTypeType object representing the type that
this type is a member of. If this type is a top-level type,
null is returnedTypeNotPresentException - if the owner type
refers to a non-existent type declarationMalformedParameterizedTypeException - if the owner type
refers to a parameterized type that cannot be instantiated
for any reasonpublic boolean equals(Object o)
Copyright © 2022. All rights reserved.