类 ParameterizedTypeImpl
- java.lang.Object
-
- com.getui.push.v2.sdk.common.type.ParameterizedTypeImpl
-
- 所有已实现的接口:
ParameterizedType,Type
public class ParameterizedTypeImpl extends Object implements ParameterizedType
Implementing class for ParameterizedType interface. 具体请看sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(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 ofTypeobjects representing the actual type arguments to this type.TypegetOwnerType()Returns aTypeobject representing the type that this type is a member of.Class<?>getRawType()Returns theTypeobject representing the class or interface that declared this type.inthashCode()static ParameterizedTypeImplmake(Class<?> rawType, Type[] actualTypeArguments, Type ownerType)Static factory.-
从接口继承的方法 java.lang.reflect.Type
getTypeName
-
-
-
-
方法详细资料
-
make
public static ParameterizedTypeImpl make(Class<?> rawType, Type[] actualTypeArguments, Type ownerType)
Static factory. Given a (generic) class, actual type arguments and an owner type, creates a parameterized type. This class can be instantiated with a raw type that does not represent a generic type, provided the list of actual type arguments is empty. If the ownerType argument is null, the declaring class of the raw type is used as the owner type.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.- 返回:
- An instance of
ParameterizedType - 抛出:
MalformedParameterizedTypeException- if the instantiation is invalid
-
getActualTypeArguments
public Type[] getActualTypeArguments()
Returns an array ofTypeobjects 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在接口中ParameterizedType- 返回:
- an array of
Typeobjects representing the actual type arguments to this type - 抛出:
TypeNotPresentException- 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 reason- 从以下版本开始:
- 1.5
-
getRawType
public Class<?> getRawType()
Returns theTypeobject representing the class or interface that declared this type.- 指定者:
getRawType在接口中ParameterizedType- 返回:
- the
Typeobject representing the class or interface that declared this type
-
getOwnerType
public Type getOwnerType()
Returns aTypeobject representing the type that this type is a member of. For example, if this type isO<T>.I<S>, return a representation ofO<T>.If this type is a top-level type,
nullis returned.- 指定者:
getOwnerType在接口中ParameterizedType- 返回:
- a
Typeobject representing the type that this type is a member of. If this type is a top-level type,nullis returned - 抛出:
TypeNotPresentException- 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 reason
-
equals
public 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."
-
-