public class Types extends Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Function<Type,Class<?>> |
TYPE_TO_CLASS_FUNCTION |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
boxedClass(Class<?> type) |
static Type |
boxedType(Type type)
Gets the boxed type of a class
|
static <C extends Class<?>> |
buildClassNameMap(Iterable<C> set)
Builds (class name -> class) map for given classes.
|
static boolean |
containsUnresolvedTypeVariableOrWildcard(Type type) |
static Type |
getArrayComponentType(Type type)
Determines the component type for a given array type.
|
static Type |
getCanonicalType(Class<?> clazz)
Returns a canonical type for a given class.
|
static Type |
getCanonicalType(Type type) |
static Set<Class<?>> |
getRawTypes(Set<Type> types) |
static Class<?>[] |
getRawTypes(Type[] types) |
static String |
getTypeId(Type type) |
static boolean |
isActualType(Type type)
Determines whether the given type is an actual type.
|
static boolean |
isArray(Type type)
Determines whether the given type is an array type.
|
static boolean |
isArrayOfUnboundedTypeVariablesOrObjects(Type[] types)
Determines whether the given array only contains unbounded type variables or Object.class.
|
static boolean |
isRawGenericType(Type type) |
public static Type boxedType(Type type)
type
- The typepublic static Type getCanonicalType(Class<?> clazz)
ParameterizedType
(with unresolved type
variables) is resolved.
If the class is an array then the component type of the array is canonicalized
Otherwise, the class is returned.public static boolean containsUnresolvedTypeVariableOrWildcard(Type type)
public static <C extends Class<?>> Map<String,C> buildClassNameMap(Iterable<C> set)
public static boolean isActualType(Type type)
type
- the given typepublic static boolean isArray(Type type)
type
- the given typepublic static Type getArrayComponentType(Type type)
type
- the given array typepublic static boolean isArrayOfUnboundedTypeVariablesOrObjects(Type[] types)
types
- the given array of typespublic static boolean isRawGenericType(Type type)
Copyright © 2016. All rights reserved.