public final class TypeHelper
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<java.lang.reflect.Type> |
flattenTypeVariables(java.lang.reflect.Type type)
Unwinds parametrized type into plain list that contains all parameters for the given type including nested parameterized types,
for example calling the method for the following type
GType
will return list of 8 elements:
[GType, GType, GDoubleType, GType, GDoubleType, Parent, Parent, Parent]
if the given type is not parametrized then returns list with one element which is given type passed into method. |
static boolean |
isGenericReturnType(java.lang.reflect.Method method) |
static boolean |
isParametrizedType(java.lang.reflect.Type t) |
static boolean |
isReturnTypeParametrized(java.lang.reflect.Method method)
Check whether return type of the given method is parametrized or not.
|
static boolean |
isTypeVariable(java.lang.reflect.Type t) |
static boolean |
isWildcardType(java.lang.reflect.Type t) |
public static boolean isGenericReturnType(java.lang.reflect.Method method)
public static boolean isReturnTypeParametrized(java.lang.reflect.Method method)
method - the methodParameterizedType, otherwise - falsepublic static boolean isParametrizedType(java.lang.reflect.Type t)
public static boolean isTypeVariable(java.lang.reflect.Type t)
public static boolean isWildcardType(java.lang.reflect.Type t)
@ParametersAreNonnullByDefault public static java.util.List<java.lang.reflect.Type> flattenTypeVariables(java.lang.reflect.Type type)
GType>, Parent>>>
will return list of 8 elements:
[GType, GType, GDoubleType, GType, GDoubleType, Parent, Parent, Parent]
if the given type is not parametrized then returns list with one element which is given type passed into method.type - the parameterized typeType