org.squirrelframework.foundation.util
Class TypeReference<T>
java.lang.Object
org.squirrelframework.foundation.util.TypeReference<T>
- Type Parameters:
T - Generic Type
public abstract class TypeReference<T>
- extends Object
- Author:
- Henry He
- See Also:
- Super Type Tokens
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeReference
protected TypeReference()
getType
public Type getType()
getRawType
public final Class<T> getRawType()
- Returns the raw type of
T. Formally speaking, if T is returned by
Method.getGenericReturnType(), the raw type is what's returned by
Method.getReturnType() of the same method object. Specifically:
- If
T is a Class itself, T itself is returned.
- If
T is a ParameterizedType, the raw type of the parameterized type is
returned.
- If
T is a GenericArrayType, the returned type is the corresponding array
class. For example: List<Integer>[] => List[].
- If
T is a type variable or a wildcard type, the raw type of the first upper bound
is returned. For example: <X extends Foo> => Foo.
Copyright © 2013-2014. All Rights Reserved.