public class ParameterizedTypeImpl extends Object implements ParameterizedType
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
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.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetTypeNamepublic 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 in interface 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 in interface 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 in interface 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 reasonCopyright © 2022. All rights reserved.